Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I could have (should have?) done that myself, but I guess I am too lazy.
Thanks Dana. Bob "Dana DeLouis" wrote in message ... Mine also fails for root files, so also needs error handling. Here's a slight change that may help with root files. Sub GetParent() Dim oFSO As Object Set oFSO = CreateObject("Scripting.FileSystemObject") With oFSO.GetFile(ActiveWorkbook.FullName).ParentFolder If .IsRootFolder Then 'No Parent Folder Debug.Print .Path Else Debug.Print .ParentFolder.Path End If End With End Sub HTH :) -- Dana DeLouis Win XP & Office 2003 "Bob Phillips" wrote in message ... "NickHK" wrote in message ... Need error checking in the situation of "C:\MyFile.xls". Mine also fails for root files, so also needs error handling. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
how can i change my default working folder to a networked folder? | Excel Discussion (Misc queries) | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
Parent Folder | Excel Programming |