changing current directory to that of the current open file

U

unnameable

Hi,

I'm working on an invoicing project which involves three seperat
spreadsheet files. The main file opens the other two via a macro.

My problem is, I can't find a way to make the current directory (usin
ChDir or the like) the directory in which the main file is present!

I know it probably would be alright if I opened the main file usin
File>Open in the Excel menu, but I would like it to work if the file i
opened direct by double clicking on it in windows explorer.

Say the file is C:\Invoicing\OrderForm.xls ... how would I make th
current directory C:\Invoicing via a macro without actually naming th
directory? I don't want it to be a permanent thing, I only want it t
happen when the spreadsheet is opened.

Any ideas
 
U

unnameable

I've re-read my post above and it seems a little jumbled!! Here'
another try at explaining my problem....

When I open the OrderForm.xls file from the folder itself, I want
macro within it to set the folder it is in to the current directory.

At the moment when I open the file this way the current director
remains as 'My Documents'.

I know the current directory changes if I open the file via the Fil
menu in Excel, but ideally I'd like it to change in both situations...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top