VBA & Macro Problems

Store an Excel XLSM File Without Losing VBA Macros

Steven ParkerSteven Parker Nov 12, 2026 869 views

Question details

Choose a storage location for an Excel macro-enabled XLSM workbook without losing VBA macros, workbook links, or Excel-specific automation.

Where to Store an Excel XLSM File While Preserving VBA Functionality
Product
Microsoft Excel XLSM macro-enabled workbook
Device & OS
not provided
Scenario
The workbook may use linked files and needs to be shared or synchronized through services such as Dropbox, OneDrive, Google Drive, or a future SharePoint site.
Observed behavior
VBA macros require the desktop version of Excel to run; Excel for the web and Google Sheets do not execute Excel VBA.
Before you start

Confirm that the workbook is saved with the .xlsm extension and that its linked source files use stable file names and locations. Make sure users open the workbook in the desktop Excel application rather than a browser-based editor.

Solution 1Recommended

Store the XLSM file in a synchronized folder and open it in desktop Excel

Use this option when you need cloud access while retaining the workbook's Excel VBA project and macro-enabled format.

An XLSM workbook can be stored locally or in a synced OneDrive, Dropbox, Google Drive, or SharePoint folder. The important requirement is opening the synced .xlsm file in the desktop Excel application, where VBA can run.

1
Keep the macro-enabled file format

In desktop Excel, select File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm). Do not save the working copy as .xlsx, because that format removes VBA macros.

2
Choose a synced storage folder

In File > Save As, select a local OneDrive, Dropbox, Google Drive for desktop, or SharePoint-synced folder. Wait for the sync client to finish uploading the .xlsm file.

3
Open the file in the desktop app

Open the workbook from File Explorer or use Excel > File > Open. If a browser opens the file first, choose Open in Desktop App instead of editing it in Excel for the web.

4
Enable trusted macros when appropriate

When Excel displays a security warning, select Enable Content only if the workbook comes from a trusted source and you expect its VBA automation to run.

Store the XLSM file in a synchronized folder and open it in desktop Excel
VBA is retained in XLSM storage: Cloud storage does not inherently remove VBA. The macros remain in the .xlsm file as long as the workbook is not converted to .xlsx, Google Sheets, or another unsupported format.
Free Microsoft Office alternative

Use WPS Office for everyday XLSM workbook viewing and editing

WPS Office is a free, lightweight office suite with a familiar spreadsheet interface for working with Excel-compatible files. It can help teams view and edit compatible workbook content during a transition, while Excel desktop remains the appropriate environment for testing and running Excel-specific VBA automation.

Open and edit compatible Excel workbook content with a familiar spreadsheet workspace.Supports Microsoft Excel file formats, including .xlsx and .xls files.Provides a lightweight option for everyday spreadsheet review and collaboration.Helps users migrate common spreadsheet work without changing familiar table, formula, and chart workflows.Use desktop Excel for validation when an XLSM workbook depends on VBA macros or Excel-specific automation.
microsoft office alternative - wps office

Frequently Asked Questions

Can I store an XLSM file in Dropbox or OneDrive?

Yes. Save the workbook as an .xlsm file in the synced Dropbox or OneDrive folder, then open it using desktop Excel. The cloud location itself does not remove the VBA project.

Will Excel for the web run macros in an XLSM workbook?

No. Excel for the web does not run VBA macros. Open the workbook in the desktop Excel application and enable content when the macro source is trusted.

Does saving an XLSM file as XLSX keep the macros?

No. The .xlsx format cannot store VBA code. In desktop Excel, use File > Save As > Excel Macro-Enabled Workbook (*.xlsm) to preserve macros.

Can Google Sheets preserve Excel VBA macros and links?

No. Google Sheets does not run Excel VBA, and converting an XLSM workbook can change Excel-specific formulas, links, and automation. Keep the original XLSM file for desktop Excel use.

How should I prepare an XLSM workbook for a SharePoint migration?

Place the XLSM workbook and its linked files in a consistent folder structure, review Data > Queries & Connections > Edit Links, and check VBA code for hard-coded file paths before syncing the folder to SharePoint.