I currently have an Excel file with VBA made with Excel 2002 for Windows. I use VBA to import data from .cvs files on another computer running Windows XP. If you read my other recent post you will see what I am doing. Now I have a user that wants to use it on a Mac running Excel 2004 for the Mac. However, it fails when it gets to the following code:
I know ActiveX is not comaptible with the Mac. Is there a way to set the folder object in VBA for Mac? I was thinking of using a test like this:
Is there a method I can use that is not ActiveX that can search through a folder and run on Windows and Mac?
Thanks.
Code:
Set appShell = CreateObject("Shell.Application")
Set oFolder = appShell.Namespace((strpath))
Code:
' Test for Macintosh OS
If Not Application.OperatingSystem Like "*Mac*" Then
Set appShell = CreateObject("Shell.Application")
Set oFolder = appShell.Namespace((strpath))
Else
' do something here for Mac object
End If
Thanks.