VBA & Macro Problems

Fix Excel 2016 for Mac VBA Workbook Saving Problems

Ayan MasoodAyan Masood Nov 20, 2026 868 views

Question details

The user needs a VBA macro to save workbooks into a subfolder in Excel 2016 for Mac.

Fix VBA Workbook Saving Problems in Excel 2016 for Mac
Product
Microsoft Excel 2016 for Mac
Device & OS
macOS
Scenario
A VBA macro uses AppleScript to create a folder and then saves workbooks into a subfolder.
Observed behavior
The macro mostly works, but it does not save files into the intended subfolder. Mac sandbox permissions, path separators, and filename parsing may need to be checked.
Before you start

Identify the intended destination folder and confirm that it exists in Finder. In the VBA editor, locate the code that builds the destination path and calls SaveAs.

Solution 1Recommended

Check Folder Access and the VBA Save Path

Use this approach when a macro creates a folder but saves a workbook to the wrong location or cannot access the destination.

1
Test the destination

In Excel, choose File > Save As and try saving a test workbook in the intended subfolder. If Excel requests access, grant it; if the folder is unavailable, check its location and permissions in Finder.

2
Inspect the generated path

Open the VBA editor and add a Debug.Print statement immediately before the SaveAs call to print the full destination path. Run the macro and inspect the output in the Immediate window.

3
Check separators and filename parsing

Compare the printed path with the intended folder and filename. Use slash-separated POSIX paths where the called API expects them, and colon-separated HFS paths where required; update Split or InStrRev calls to match the path format being parsed.

4
Verify the SaveAs call

Check that the SaveAs Filename argument includes the subfolder, a separator, and the complete filename. Set FileFormat to match the extension, such as 52 for a macro-enabled .xlsm workbook, and rerun the macro.

Check Folder Access and the VBA Save Path
Path formats depend on the API: Do not replace every colon with a slash without checking how the path is used. AppleScript, VBA, and individual Mac APIs may expect different path representations.
Free Microsoft Office alternative

Work With Excel Spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easier to move everyday spreadsheet work. It does not fix Excel for Mac sandbox permissions, and VBA compatibility may vary.

Open and edit common Excel formats, including XLSX and XLS.Use a familiar spreadsheet interface for everyday workbook tasks.Save spreadsheet files without relying on the affected Excel installation.Use a free, lightweight office suite for common document work.
microsoft office alternative - wps office

Frequently Asked Questions

Should I change all colons in my Mac VBA paths to slashes?

Not automatically. Slashes are used in POSIX paths, while colons can separate components in HFS paths. Check which format the specific VBA or AppleScript operation expects, and adjust filename parsing to match.

How can I see the path my macro is trying to save?

Add Debug.Print immediately before the SaveAs call and print the full Filename value. Run the macro and inspect the Immediate window in the VBA editor.

What if Excel cannot access the destination folder?

Try File > Save As in Excel and grant access if prompted. Check the folder's permissions in Finder, or test with an appropriate folder inside Excel's sandbox container.

Which format should I use to keep a workbook's VBA macros?

Save the workbook as .xlsm and use the matching macro-enabled FileFormat in the VBA SaveAs call, such as 52.