View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default How to get the current path

"Start In" in a short cut can point to any valid location, but it seems to
be ignored by Excel, if indeed Excel is even told about that setting,
possibly via DDE if anything.
Excel would seems to read from .DefaultFilePath instead upon start up.

Also I don't see how VB5/6's FileListBox exposes the StartIn parameter of a
short cut.

If you make a simple VB5/6 app with only a command button:

Private Sub Command1_Click()
MsgBox CurDir
End Sub

and start the app with various shortcut pointing to different StartIn
folders, you can see the changes.

Excel does not seem to work like this though.
Out of curiousity, why does it matter ?

NickHK

"Stefan Mueller" wrote in message
ps.com...
Like already mentioned, in real VB the FileListBox (FileListBox1.Path)
shows this information.
Unfortunately there's no FileListBox in VBA. Therefore I'm looking for
another way to get this information.

ActiveWorkbook.Path is fine if you start the real Excel sheet. But it
does not work if you start the Excel sheet via a shotcut. In that case
ActiveWorkbook.Path still shows the path where the real Excel sheet is
located and not where the shortcut is located resp. what is defined in
'Start in:'.