View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Knowing what Folder I'm in when I open from a shortcut

Still not sure that I fully understand what it is you want. The following
code out of help (slightly modified with the filespec) provides info about
the current workbook.

--
Regards,

OssieMac


"Héctor Miguel" wrote:

hi, !

I start from a folder.
I open an excel file from a shorcut (to another folder)
but I am still in the original folder I started in.


at that moment, you know exactly which folder you are and/or
where is located the short-cut link-file to open your document/excel

My question is how the in Excel VBA programming environment can I know
what folder I started the Excel program from (not the folder the excel program is in).


suppose excel is closed, and suddenly it opens by means of... whatever, so...
how would excel be sure and tell you where you were while excel opens ?
- an hyperlink from another application (word, ppt, ...) ???
- a shorcut from your desktop ???
- a shortcut from windows-explorer or MyPC, or... ???

AFAIK, when excel opens from a shortcut, it's current directory is still the Application.DefaultFilePath

hth,
hector.