How to get the full path name of the open workbook in a macro

  • Thread starter Thread starter Flystar
  • Start date Start date
F

Flystar

How can I get the full path name for the open workbook using a macro? I
have tried using the CurDir() function but it is not working.

eg. If I open my workbook from C:\Data\Excel\, I want to be able to get
this string "C:\Data\Excel\"

I am using excel 2000 on Win98SE
 
How can I get the full path name for the open workbook using a macro? I
have tried using the CurDir() function but it is not working.

eg. If I open my workbook from C:\Data\Excel\, I want to be able to get
this string "C:\Data\Excel\"

try this:

strPath = ActiveWorkbook.Path & "\"

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)
 
Thank you for your replies. I have chosen to go with a combination:

ActiveWorkbook.Path & Application.PathSeparato
 

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

Back
Top