View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How to get the current path

I don't think that the workbook file itself is in C:\temp. The workbook could
be anywhere. But there's a shortcut on the desktop that points to the correct
location.

But inside that shortcut (rightclick on it and choose properties, then Shortcut
tab) you'll see another spot to specify a "start in" folder.

I have no idea how to get that information based on the opened workbook.

Gary Keramidas wrote:

if i open a workbook from c:\temp it returns c:\temp

from the immediate window

?activeworkbook.Path
C:\Temp

--

Gary

"Stefan Mueller" wrote in message
ups.com...
ActiveWorkbook.Path is closer to my wanted function than CurDir
because it shows e.g. 'C:\Documents and Settings\Administrator
\Desktop' if I start the Excel workbook from the Desktop.
However, it doesn't show 'C:\Temp' if in 'Start in:' of the shortcut
of the Excel workbook is written 'C:\Temp'.


--

Dave Peterson