logo
search
VBA & Macro Problems

Fix "The script cannot be saved" Error in Excel Macros and Scripts

John WilsonJohn Wilson Sep 28, 2026 869 views

Question details

The user is unable to save a recorded macro or script in Excel due to a system error.

How to Fix Excel Macro and Office Script Saving Errors
Product
Microsoft Excel
Device & OS
not provided
Scenario
Recording a macro or Office Script to automate spreadsheet tasks.
Observed behavior
Excel displays the error message "Something went wrong. The script cannot be saved" and fails to store the newly recorded script or macro.
Before you start

Before troubleshooting, confirm whether you are recording a traditional VBA Macro or a modern cloud-based Office Script, as the permissions and file requirements differ significantly between the two.

Solution 1Recommended

Verify Workbook Format and Organizational Policies

Ensure your file format supports macros and that your Microsoft 365 administrator allows script execution.

Office Scripts and VBA macros require specific file types and tenant-level permissions to function correctly. If your organization restricts cloud automation, saving scripts will fail.

1
Check the workbook file format

Go to File > Save As and ensure the "Save as type" dropdown is set to Excel Macro-Enabled Workbook (*.xlsm) if you are working with traditional VBA macros.

2
Verify Microsoft 365 admin settings

If you are using a corporate or school account, contact your IT administrator to confirm that "Office Scripts" is enabled for your user account within the Microsoft 365 Admin Center.

3
Check third-party cookie settings

If you are using Excel on the web, ensure that your browser allows third-party cookies for Microsoft domains, as blocking them can prevent Office Scripts from authenticating and saving.

Verify Workbook Format and Organizational Policies
Administrator Access Required: Only tenant administrators can change global Office Script permissions. If the feature is turned off at the organizational level, local Excel settings cannot override it.
Free Microsoft Office alternative

Experience seamless spreadsheet management with WPS Office

Tired of complicated Microsoft 365 configurations, cloud syncing issues, and script saving errors? Switch to WPS Office, a fast, lightweight, and highly compatible alternative that offers a familiar interface and reliable tools for all your daily spreadsheet tasks.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Open your existing spreadsheets: Launch WPS Spreadsheet and open your existing Excel workbooks. WPS will automatically recognize and preserve your data, formulas, and formatting.
  3. 3. Access developer tools: Navigate to the Developer tab to effortlessly manage and execute your local macros without relying on complex cloud script settings.
Free and lightweight office suite with rapid launch speedsExcellent compatibility with Microsoft Excel (.xlsx, .xlsm, .csv) formatsRobust local support for traditional VBA macros in WPS Spreadsheet ProNo complicated cloud tenant configurations or admin approvals required to work efficiently
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between VBA macros and Office Scripts?

VBA (Visual Basic for Applications) is a traditional, local scripting language used in desktop versions of Office. Office Scripts are modern, cloud-based TypeScript macros used in Microsoft 365 and Excel on the web, designed to work seamlessly with Power Automate.

Why does Excel say my macro cannot be saved?

This typically occurs if the workbook is not saved in a macro-enabled format (.xlsm), if your organization's IT policies restrict scripting, or if there is a synchronization error with Microsoft's cloud services when using Office Scripts.

How do I enable Office Scripts in Microsoft 365?

Office Scripts must be enabled by a tenant administrator. They can do this by logging into the Microsoft 365 Admin Center, navigating to Settings > Org settings, and toggling the Office Scripts feature on for the organization or specific groups.