# Excel VBA: FileFind on Mac



## creatorlars (Feb 13, 2003)

Hello,

I'm trying to get some Excel code that works on a PC to work with the macintosh version of Excel, this program is used to open up all the files in a directory and it's subfolders, and run a second function on each one individually. The problem here is that Mac uses FileFind instead of Filesearch, and I can't get it to work the same way it works on the PC.

No matter what I try, the search always comes up with 0 items found. I've tried a hundred different things from commenting out lines of code to searching for different names/types, and everything else. Is there something I'm missing? Here's the code: 

Sub GetAllFiles() 

Dim lng As Long 

With Application.FileFind 
.Options = msoOptionsNew 
.SearchPath = "Lindas G4 350:ExcelTest" 
.SearchSubFolders = True 
.FileType = MacID("XCEL") 
.Execute 

MsgBox .FoundFiles.Count 

For lng = 1 To .FoundFiles.Count 
Workbooks.Open .FoundFiles(lng) 
ReplaceCharacters 'run second macro 
ActiveWorkbook.Close True 
Next lng 

End With 

End Sub

Thanks so much in advance,
Daniel Larsen
[email protected]


----------

