Link to home
Start Free TrialLog in
Avatar of bctek
bctek

asked on

One line of code...need help

I keep getting an error that the file cannot be found:

Excel.Workbooks.Open("fake_users.xls")

yet fake_users.xls exists right in my BIN directory.  How do I get it to open this worksheet with a relative path to the EXE?
Avatar of Computron
Computron

Try specifying the full path

Excel.Workbooks.Open("c:\myfolder\fake_users.xls")
Avatar of bctek

ASKER

i dont want the full path, i want a relative path to the EXE.
Avatar of bctek

ASKER

ERROR returned:  "Additional information: 'fake_users.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct."
ASKER CERTIFIED SOLUTION
Avatar of Computron
Computron

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bctek

ASKER

still doesn't work :(
same error returned.
" '.\fake_users.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct."

the file exists right next to the .exe
If I put the absolute path in, it works fine, but can't get it to open relatively
Can you paste the full path of where the file is
Avatar of bctek

ASKER

the app.path worked.   ALl set now!  Thanks
Good, sorry I misread the question at first. Have a pleasant evening