Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone provide me with a working code snippet to find all folders in a
directory on a Mac? I'm running Excel 2004 on a mac, and know that I need to use something like FolderName = Dir(Input_Dir, MacID("TEXT")) but something other than "TEXT" needs to go there. Can someone tell me what the resource type is that I need to use to specify a folder? Actually, I want to find the names of all sub folders within a folder so I think I need to call it as above and then call FolderName = Dir("", MacID("TEXT")) or something like that for subsequent calls. Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found a way to do it without MacID. Here's what worked for me:
On Error Resume Next subDir(1) = Dir(pathTbox, vbDirectory) On Error GoTo 0 If subDir(1) = "" Then MsgBox "No sub directories were found in " & pathTbox Exit Sub End If j = 1 While subDir(j) < "" On Error Resume Next j = j + 1 subDir(j) = Dir() On Error GoTo 0 Wend j = j - 1 msg = "" For i = 1 To j msg = msg & subDir(i) & vbCr Next i MsgBox "The " & j & " sub directories found were " & msg Stop "T_o_n_y" wrote: Can someone provide me with a working code snippet to find all folders in a directory on a Mac? I'm running Excel 2004 on a mac, and know that I need to use something like FolderName = Dir(Input_Dir, MacID("TEXT")) but something other than "TEXT" needs to go there. Can someone tell me what the resource type is that I need to use to specify a folder? Actually, I want to find the names of all sub folders within a folder so I think I need to call it as above and then call FolderName = Dir("", MacID("TEXT")) or something like that for subsequent calls. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List folders but not sub folders | Excel Programming | |||
Find Folders | Excel Programming | |||
DIR function and compressed folders | Excel Programming | |||
DIR function and compressed folders | Excel Programming | |||
Dir() function to return either List of files or folders | Excel Programming |