Results 1 to 7 of 7

Thread: Unzip in Excel/VBA for Mac - CreatObject("Shell.Application") not working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Jan 2023

    Unzip in Excel/VBA for Mac - CreatObject("Shell.Application") not working

    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 :
    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
    This is how I would call it:
    Call UnzipFile("/Users/Colin/Documents/Test/", "/Users/Colin/Documents/Test")
    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.

    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 and run with:
    Shell "/Users/Colin/Documents/Computing/Scripts/"
    Maybe there is a more elegant way to do this within VBA.
    Last edited by Colin_In_BE; 01-13-2023 at 12:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts