Executing Shell File from Excel VBA in Mac Sonoma throws Type Mismatch

29 views Asked by At

I am unable to execute a shell file from Excel VBA in OSX Sonoma.

Have been down a long rabbit hole and here is where I am stuck.

wResult = AppleScriptTask("GetData.scpt", "", "")

This line throws an Run-time error '13': Type mismatch

Things I have tried:

  • wResult is currently a variant, I have tried it as a string. I have tried all of the input parameters as variant and string variables.

  • I have confirmed that the scpt file is in the proper directory:

    /users/Otis/Library/Application Scripts/com.microsoft.excel
    
  • I have confirmed that the scpt file has permissions adjusted:

    -rwxrwxrwx@ 1 Otis  staff  486 Jan 27 17:34 GetData.scpt
    
  • I have confirmed the properties of the file being called by the scpt file

    -rwxrwxrwx@ 1 Otis  staff  20657 Feb 18 08:34 GetData.sh
    
  • Script Editor and Excel have full disk access.

  • Under Privacy & Security -> Accessibility Script Editor, Automator, and Excel are enabled to control the computer

  • The sctp file works perfectly when called from Sript Editor and from a command line.

0

There are 0 answers