File Format & Compatibility

How to Fix Excel Macro-Free File Error When Importing a Google Sheet

Jason MillerJason Miller Oct 16, 2026 875 views

Question details

The user encounters a macro-free file error in Excel when opening an XLSX file exported from Google Sheets, preventing the file from functioning normally.

Fix Excel Macro-Free File Error When Importing a Google Sheet
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening an exported Google Sheets XLSX file in Excel that contains custom Apps Script functions or embedded scripts.
Observed behavior
Excel displays a warning that the XLSX file is macro-free but contains macro-enabled content, triggering an error due to incompatible scripts.
Before you start

Before exporting the file from Google Sheets, identify any cells that rely on custom Apps Script functions, as these scripts cannot be executed natively within Excel and will need to be replaced.

Solution 1Recommended

Remove Custom Functions in Google Sheets and Recreate in Excel

Google Sheets custom functions written in Apps Script are incompatible with standard Excel files. You must replace them with standard formulas or recreate them using Excel VBA.

Because Google Apps Script uses JavaScript and Excel macros use VBA, there is no direct compatibility between the two automation systems. Excel flags the imported Apps Script content as an unsupported macro within a standard (.xlsx) file, causing the error.

1
Identify Custom Functions

Open your original workbook in Google Sheets and locate any cells that use user-defined functions created via Extensions > Apps Script.

2
Convert Functions to Static Values

If the custom function results do not need to be dynamic in Excel, copy the cells containing the custom functions and use Edit > Paste special > Values only to replace the formulas with static text.

3
Export as XLSX

Click File > Download > Microsoft Excel (.xlsx) to export a clean version of the workbook without the active custom formulas.

4
Recreate Logic Using Excel VBA

Open the downloaded XLSX file in Excel. Press ALT + F11 to open the VBA Editor, click Insert > Module, and rewrite your custom function logic using standard VBA.

5
Save as a Macro-Enabled Workbook

Go to File > Save As, and choose 'Excel Macro-Enabled Workbook (*.xlsm)' from the file format dropdown to properly support your new VBA functions.

Remove Custom Functions in Google Sheets and Recreate in Excel
Alternative Method: If the custom function logic is simple, try replacing it with a combination of native Excel formulas (such as IF, VLOOKUP, or INDEX/MATCH) before exporting to avoid using macros entirely.
Free Microsoft Office alternative

Handle Spreadsheets Seamlessly with WPS Office

Avoid complicated Microsoft Office compatibility errors and macro warnings. WPS Office provides a lightweight, highly compatible spreadsheet solution that perfectly supports standard XLSX formats, advanced formulas, and daily data management tasks without the heavy price tag.

Highly compatible with Microsoft Excel (.xlsx, .xlsm, .xls) file formats.Free, lightweight, and easy-to-use Microsoft Office alternative.Familiar spreadsheet interface ensuring a seamless transition and zero learning curve.Built-in support for advanced data analysis and standard spreadsheet functions.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my downloaded Google Sheet say it contains macros?

Google Sheets often utilize Apps Script for custom formulas, automated workflows, or embedded buttons. When you export the file to an XLSX format, Excel detects this underlying script and flags it as a macro, even though the file is saved as a macro-free (.xlsx) workbook.

Can I convert Google Apps Script directly to Excel VBA?

There is no built-in or automated way to convert Google Apps Script (which is based on JavaScript) directly into Excel VBA. You must manually rewrite the automation logic in VBA after importing the file into Excel.

How do I save a workbook with macros in Microsoft Excel?

To safely store and execute VBA macros in Excel, you cannot use the standard .xlsx extension. You must navigate to File > Save As, and select 'Excel Macro-Enabled Workbook (*.xlsm)' from the format dropdown menu.