I have a script that reads information from an excel file and otputs the information to a text file. Other people will be using this script, so I just tell them to put the script and the input file in the same folder and it should run. How can I get the Script to find the excel file in the same folder that the script is in, but not necessarily the same location every time? I've tried
Set objWorkbook = objExcel1.Workbooks.Open ("/budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open ("..\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open ("\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open
(dir &"\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open
(directory &"\budget_input.xls")
But I get the error that it cannot find the file every time.
Set objWorkbook = objExcel1.Workbooks.Open ("/budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open ("..\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open ("\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open
(dir &"\budget_input.xls")
Set objWorkbook = objExcel1.Workbooks.Open
(directory &"\budget_input.xls")
But I get the error that it cannot find the file every time.