Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default GetDirectory

Is there a GetDirectory that works similar to GetFilename
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default GetDirectory

GetFolder

"Paul" wrote:

Is there a GetDirectory that works similar to GetFilename

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default GetDirectory

just 2007 though init?

"Joel" wrote:

GetFolder

"Paul" wrote:

Is there a GetDirectory that works similar to GetFilename

  #4   Report Post  
Posted to microsoft.public.excel.programming
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetDirectory Function Todd Excel Programming 2 May 11th 04 11:48 PM


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"