View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default File folder dialog

The requested "the folder that the excel file that ran the macro is in" is actually

ThisWorkbook.Path

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Steve Danielson [MS]" wrote in message
...
Try:

ThisFolder = ActiveWorkbook.Path

If the workbook has been saved, this will give the folder in which it is
saved. You don't need to use ActiveWorkbook if you have a reference already
to the workbook for which you wish to receive the path.

There is also an Application.Path property which gives the path to where
the application is run from.

Are you wanting the folder of a specific workbook that you load or some
other folder?

Steve

For information and sample code for integrating Office with Visual Basic,
Visual C++, Internet Scripts, and other programming languages, please see
http://msdn.microsoft.com/library/te...SOfficeDev.htm. This site
contains the most up-to-date information for using developer tools for
Office integration and extensibility.

Best regards,
Steve Danielson
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? Please visit the Microsoft Security & Privacy Center
(http://www.microsoft.com/security) for the latest news on security updates.