A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Your VBA code looks properly formed and other than a missing declare of the "i" variable it compiles and appears to be fine. However, you did not show us how you are currently listing the path strings.
Office for the Mac uses the colon character as the path separator versus the backslash on a PC. So that is the first thing you must change in your path strings. The second thing you must change are the directory location names.
In all of my coding on the Mac I use the following to obtain the base directory strings and then add as appropriate any remaining subfolders. Note the use of colons (":").
Sub getPaths()
Dim UserHome As String, UserLibrary As String, UserAppData As String
Dim UserDesktop As String, UserDocuments As String, UserMovies As String
Dim UserMusic As String, UserPictures As String, UserPreferences As String
Dim UserTemplates As String
UserHome = MacScript("return (path to home folder) as string")
UserLibrary = UserHome & "Library:"
UserAppData = UserLibrary & "Application Support:"
UserDesktop = MacScript("return (path to desktop folder) as string")
UserDocuments = MacScript("return (path to documents folder) as string")
UserMovies = MacScript("return (path to movies folder) as string")
UserMusic = MacScript("return (path to music folder) as string")
UserPictures = MacScript("return (path to pictures folder) as string")
UserPreferences = MacScript("return (path to preferences folder) as string")
UserTemplates = Options.DefaultFilePath(wdUserTemplatesPath) & ":My Templates:"
End Sub
The above will work in all Mac Office applications (Word, Excel, PowerPoint) as long as you include a Reference to each application's Object Model in the VBE > Tools > References settings, which then allows the "wdUserTemplatesPath" property to work in your Excel or PowerPoint VBA code.
In case the above paragraph didn't make sense. Open the VBE (Visual Basic Editor) using the shortcut Option+F11 or FN+Option+F11 on some keyboards and go to Tools > References... and set it like this:
Hope this helps