Thread: GetDirectory
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default 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