I start my excel program from a "Shortcut" in "Folder 1".
That shortcut points an Excel program in "Folder 2".
When Excel is started,
Parent.Path returns "Folder 2",
but I really need to know what "Folder 1" was.
It seems that should be available as
when I do "Save File As"
it is pointing to "Folder 1".
Is there a way to find what "Folder 1" really was from the VBA enviornment.
Thanks for the help,
Mac
Last edited by CaptMac; 10-23-2008 at 02:02 PM. Reason: Got my answer
I don't think you're going to find Folder 1 unless you can find something akin to a call stack in Windows API.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
In Excel, when I open <File>, <Save As>
it points to "Folder 1".
Is there any way in VBA of accessing this information?
Mac
can you not go up a level in the directory structure in the save-as dialog box?
I'm not trying to "go up a level".
What I want to get in VBA is the path to directory that is displayed when I do <File>, <Save As>.
And this is not what is displayed in "Parent.Path".
Mac
When you say 'Excel program', I'm assuming you mean a workbook.I start my excel program from a "Shortcut" in "Folder 1" that points an Excel program in "Folder 2". When Excel is started, Parent.Path returns "Folder 2", but I really need to know what "Folder 1" was.
It seems that should be available as when I do "Save File As" it is pointing to "Folder 1".
When I do that, the default SaveAs path is "Folder 2".
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Yes, I mean opening a workbook in Excel that I also execute VBA programs in.
Mac
Right.
Well, as I said, the default saveas path for me is the directory the workbook is in, not the directory containing the shortcut from which it was opened.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Hello CaptMac,
The shortcut only contains information about the Target, the file to be opened. It contains the full path of file and an auxillary folder path for files the program may require. It does not contain any information about its own location. It is not possible to back track from the program to the shortcut using either VBA or the API.
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks