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?
bctekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ComputronCommented:
Try specifying the full path

Excel.Workbooks.Open("c:\myfolder\fake_users.xls")
0
bctekAuthor Commented:
i dont want the full path, i want a relative path to the EXE.
0
bctekAuthor Commented:
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."
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ComputronCommented:
This is a relative directory that equals the current if this is what you mean
Excel.Workbooks.Open(".\fake_users.xls")
or if the bin directory is under your current then
Excel.Workbooks.Open(".\bin\fake_users.xls")
or app.path will look in the current directory like so
Excel.Workbooks.Open(app.path & "\fake_users.xls")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bctekAuthor Commented:
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
0
ComputronCommented:
Can you paste the full path of where the file is
0
bctekAuthor Commented:
the app.path worked.   ALl set now!  Thanks
0
ComputronCommented:
Good, sorry I misread the question at first. Have a pleasant evening
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.