Mik, et al,

I'm trying to read the directory that contains my source and target files, as well as my "program" XL file. I'm using the following development code which works beautifully on my PC and should work on the Mac from what I read in Help.

As noted below, the line "FileName = Dir(FileSpec)" fails to return anything and I've verified by the debug.print in the calling program that we are in the proper directory/folder. Does Mac expect something different form "*.xls" as the trailing piece of FileSpec ?

thanks,

Ron

[vba]Option Explicit

Sub Test_GetFileList()
Dim p As String, x As Variant, i As Integer

p = ThisWorkbook.Path & ":*.xls*"
Debug.Print p

x = GetFileList(p)
Select Case IsArray(x)
Case True 'files found
MsgBox UBound(x)
Sheets("Sheet1").Range("A:A").Clear
For i = LBound(x) To UBound(x)
Sheets("Sheet1").Cells(i, 1).Value = x(i)
Next i
Case False 'no files found
MsgBox "No matching files"
End Select
End Sub

Function GetFileList(FileSpec As String) As Variant
' Returns an array or filename that match FileSpec
' If no matching files are found, it returns False
Dim FileArray() As Variant
Dim FileCount As Integer
Dim FileName As String

FileCount = 0
FileName = Dir(FileSpec) '<<< this fails to return a file list
Debug.Print Dir(FileSpec)
If FileName = "" Then GoTo NoFilesFound

' Loop until no more matching files are found
Do While FileName <> ""
FileCount = FileCount + 1
ReDim Preserve FileArray(1 To FileCount)
FileArray(FileCount) = FileName
FileName = Dir()
Loop
GetFileList = FileArray
Exit Function

NoFilesFound:
GetFileList = False
End Function[/vba]