Thread: GetDirectory
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
K_Macd K_Macd is offline
external usenet poster
 
Posts: 54
Default 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