Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
Is there a GetDirectory that works similar to GetFilename
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
GetFolder
"Paul" wrote: Is there a GetDirectory that works similar to GetFilename |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
just 2007 though init?
"Joel" wrote: GetFolder "Paul" wrote: Is there a GetDirectory that works similar to GetFilename |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
Paul
Your query could have been little more descriptive...() If you are looking at browsing and selecting a folder you can use the below function to browse for a folder; Function GetFolder() As String Dim objShell As Object, objTemp As Object Set objShell = CreateObject("Shell.Application") Set objTemp = objShell.BrowseForFolder(0, "Select folder", 552) If Not objTemp Is Nothing Then GetFolder = objTemp.Self.Path End Function ------------------------------------------------------------------------------------------ If you are referring to GetFileName method you have a similar method within FileSystemObject called GetFolder which returns a Folder object corresponding to the folder in a specified path. Syntax: (refer help) object.GetFolder(folderspec) object is always the name of a FileSystemObject. folderspec is the path (absolute or relative) to a specific folder If this post helps click Yes --------------- Jacob Skaria "Paul" wrote: Is there a GetDirectory that works similar to GetFilename |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
How about
http://www.vbaexpress.com/kb/getarticle.php?kb_id=284 --JP On Oct 16, 5:40*am, Paul wrote: Is there a GetDirectory that works similar to GetFilename |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetDirectory
Paul
The BrowseFor Folder method works quite well. Jacob I have only used 512 for the 3rd parameter - is 552 another option or a typo? Note that you can set 4th parameter as a starting folder but that you can only select that folder or subfolders. You cannot retreat back up the tree which can be useful sometimes. Have you come across this limitation and ever come across a remedy. Thanks -- Ken "Using Dbase dialects since 82" "Started with Visicalc in the same year" "Jacob Skaria" wrote: Paul Your query could have been little more descriptive...() If you are looking at browsing and selecting a folder you can use the below function to browse for a folder; Function GetFolder() As String Dim objShell As Object, objTemp As Object Set objShell = CreateObject("Shell.Application") Set objTemp = objShell.BrowseForFolder(0, "Select folder", 552) If Not objTemp Is Nothing Then GetFolder = objTemp.Self.Path End Function ------------------------------------------------------------------------------------------ If you are referring to GetFileName method you have a similar method within FileSystemObject called GetFolder which returns a Folder object corresponding to the folder in a specified path. Syntax: (refer help) object.GetFolder(folderspec) object is always the name of a FileSystemObject. folderspec is the path (absolute or relative) to a specific folder If this post helps click Yes --------------- Jacob Skaria "Paul" wrote: Is there a GetDirectory that works similar to GetFilename |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
GetDirectory Function | Excel Programming |