Fix Excel VBA Error 75 When Creating an AppleScript File on macOS
Question details
Create an AppleScript file in Excel's macOS Application Scripts folder so that Excel VBA can use it.

- Product
- Microsoft Excel for Mac
- Device & OS
- macOS
- Scenario
- An Excel VBA macro needs an AppleScript file in the com.microsoft.Excel Application Scripts folder.
- Observed behavior
- VBA can read files in the folder but returns run-time error 75, Path/File access error, when attempting to create a new .scpt file.
Check that Excel's scripts folder exists at ~/Library/Application Scripts/com.microsoft.Excel. Plan the script's handler name and parameter before saving it; AppleScriptTask requires both the file name and handler name.
Save the AppleScript with Script Editor and call it from Excel VBA
Use a user-authorized app to place the script in Excel's scripts folder, then call its handler from VBA.
macOS sandboxing or permissions can prevent Excel VBA from creating a file even when Excel can read existing files. Saving the script separately avoids relying on VBA to write to the protected location.
AppleScriptTask is available in supported versions of Excel for Mac. The script file must already be in Excel's Application Scripts folder.
Open Applications > Utilities > Script Editor. Enter a handler, for example: on greet(userName) return "Hello, " & userName end greet
Choose File > Save. In the save dialog, press Command+Shift+G and enter ~/Library/Application Scripts/com.microsoft.Excel. Save the file as Hello.scpt in Script format. If macOS requests access, review and approve the prompt as appropriate.
In the Excel VBA editor, add a call such as result = AppleScriptTask("Hello.scpt", "greet", "World") to a macro, then run the macro. The file name and handler name must match the saved script.
If the script controls another app and macOS blocks it, open System Settings > Privacy & Security > Automation and review the relevant permission. Also check any error displayed by Script Editor or Excel.

Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative for everyday spreadsheet work. Its familiar interface and support for Microsoft Excel formats make it easier to move existing files between office suites. It does not fix Excel's macOS sandbox permissions or guarantee compatibility with Excel VBA and AppleScriptTask.

Frequently Asked Questions
Why can Excel VBA read the folder but not create a script there?
Reading an existing file and creating a new one can be subject to different macOS sandbox or permission restrictions. Save the script with Script Editor instead of assuming VBA has write access.
Where should I save an AppleScript for AppleScriptTask?
Save the .scpt file in ~/Library/Application Scripts/com.microsoft.Excel. In a Finder or save dialog, press Command+Shift+G and enter that path.
Can I call a script stored elsewhere with AppleScriptTask?
AppleScriptTask expects the script in Excel's Application Scripts folder. A file stored elsewhere may be useful for another workflow, but it cannot be called directly by AppleScriptTask from that location.
Will granting Automation permission fix error 75?
Not necessarily. Automation permission controls whether an app can control another app; it does not automatically grant Excel permission to create files in the scripts folder. Check System Settings > Privacy & Security > Automation only when the script needs to control another app.




