1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Excel VBA: FileFind on Mac

Discussion in 'DOS/Other' started by creatorlars, Feb 13, 2003.

Thread Status:
Not open for further replies.
  1. creatorlars

    creatorlars Thread Starter

    Joined:
    Feb 13, 2003
    Messages:
    1
    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]
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/118676

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice