Hello,I'm trying to get some VBA to work on my Mac (Big Sur 11.7.2) to Unzip a Zip file.
This is the code that would normally work on a Windows system ... but, I have a Mac :
This is how I would call it:Sub UnzipFile(zippedFileFullName As Variant, unzipToPath As Variant) Dim ShApp As Object Set ShApp = CreateObject("Shell.Application") ShApp.Namespace(unzipToPath).CopyHere ShApp.Namespace(zippedFileFullName).items End Sub
When I call it (or step through the Sub), as ActiveX isn't available on the Mac, I get: Run-Time error '429': ActiveX component can't create object.Call UnzipFile("/Users/Colin/Documents/Test/eurofxref-hist.zip", "/Users/Colin/Documents/Test")
Does anyone have an idea how to get an equivalent solution working on a Mac?
Many thanks.
UPDATE : Just found one way to do it, with a Mac App that I wrote to call the Archive Utility.app and run with:
Maybe there is a more elegant way to do this within VBA.Shell "/Users/Colin/Documents/Computing/Scripts/Expand_Zip.app"





Reply With Quote