By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Access/Excel changing current directory

P: n/a
I have an Access database/procedure that exports data to an Excel
spreadsheet and opens that spreadsheet using automation

I need to change the current directory/drive in Excel to be the same as
that of the spreadsheet I've created so that the user is in the correct
place in Excel when the Access procedure finishes.

I know of ChDrive() and ChDir() but how do I manipulate these functions
in my Excel Application object from Access?

------
Sean

"If at first you don't succeed, go to sleep"

*** Sent via Developersdex http://www.developersdex.com ***
Apr 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Sean Howard" <se*********@TimeaIntLtd.hu> wrote in message
news:Sz*************@news.uswest.net...
I have an Access database/procedure that exports data to an Excel
spreadsheet and opens that spreadsheet using automation

I need to change the current directory/drive in Excel to be the same as
that of the spreadsheet I've created so that the user is in the correct
place in Excel when the Access procedure finishes.

I know of ChDrive() and ChDir() but how do I manipulate these functions
in my Excel Application object from Access?

------
Sean

"If at first you don't succeed, go to sleep"

*** Sent via Developersdex http://www.developersdex.com ***


Don't know if it is the best way but here is one way:

objExcelApp.ExecuteExcel4Macro "DIRECTORY(""C:\My Folder Name"")"

ExecuteExcel4Macro can come in very handy sometimes because Excel 4 macro
commands can do things that can not be done in "improved" later versions of
Excel using VBA.

- Joe
Apr 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.