Store an Excel XLSM File Without Losing VBA Macros
Question details
Choose a storage location for an Excel macro-enabled XLSM workbook without losing VBA macros, workbook links, or Excel-specific automation.

- 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.
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.
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.
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.
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.
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.
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.

Keep linked workbooks and source files in a consistent folder structure
Use this option when the XLSM workbook contains formulas, queries, or VBA code that refers to other files.
Avoid browser editing and Google Sheets conversion for VBA workbooks
Use this guidance when collaborators may open the file through Google Drive, Excel for the web, or Google Sheets.
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.

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.




