VBA & Macro Problems

Share an Excel XLSM Workbook Without Losing Macros and Slicers

Ayan MasoodAyan Masood Nov 13, 2026 870 views

Question details

The user needs to share a macro-enabled Excel workbook stored on OneDrive while retaining its VBA macros, slicers, PivotTables, and data validation.

Share an Excel XLSM Workbook Without Losing Macros and Slicers
Product
Microsoft Excel and OneDrive
Device & OS
not provided
Scenario
Share an XLSM workbook with other users who need access to its desktop Excel features.
Observed behavior
Recipients need to use the workbook's macros and advanced features, rather than only view or edit it in a browser.
Before you start

Confirm that the workbook is saved as .xlsm and that recipients have a supported desktop version of Excel with permission to access the file. Check whether the VBA code depends on add-ins, local files, or other components that recipients also need.

Solution 1Recommended

Share the workbook through OneDrive and open it in desktop Excel

Use this method when recipients should work with the shared cloud file while using its macros and advanced Excel features.

OneDrive and SharePoint can store and share an XLSM workbook, but Excel for the web cannot run VBA macros. Opening the shared file in desktop Excel allows recipients to use features supported by their Excel version and environment.

1
Confirm the macro-enabled file format

In desktop Excel, open File > Save As and confirm that the file type is Excel Macro-Enabled Workbook (*.xlsm). Keep this format when saving changes.

2
Share the cloud file

In OneDrive or the SharePoint document library, select the workbook and click Share. Choose the recipients and grant editing permission if they need to modify the workbook, then send the invitation or link.

3
Switch from the browser to desktop Excel

Ask each recipient to open the shared link and select Open in Desktop App or Open in app from the workbook's opening options. The wording and location can vary by interface.

4
Check macros and workbook controls

In desktop Excel, follow any security prompts only if the workbook and its source are trusted. Test the macro buttons, slicers, PivotTable refresh, and data-validation lists before starting shared work.

Share the workbook through OneDrive and open it in desktop Excel
Macro security still applies: Opening the file in desktop Excel does not automatically enable VBA. Organization policies may block macros, and missing dependencies or platform-specific code can prevent them from running.
Free Microsoft Office alternative

Use WPS Office for Everyday Spreadsheet Work Alongside Excel

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for an easy transition to everyday editing. Keep using a supported desktop version of Microsoft Excel for this VBA-dependent workbook; WPS is not a guaranteed substitute for its macros, slicers, and other advanced features.

Free spreadsheet tools for routine data entry, formulas, and reporting.Microsoft Excel .xlsx and .xls format compatibility for everyday spreadsheet exchange.A familiar Office-style interface that makes migration easier.A lightweight option for related spreadsheet tasks while the macro-enabled workflow remains in desktop Excel.
microsoft office alternative - wps office

Frequently Asked Questions

Can recipients run VBA macros in Excel for the web?

No. Excel for the web can open macro-enabled workbooks, but it cannot run VBA macros. Recipients should use Open in Desktop App or download the .xlsm file and open it in a supported desktop version of Excel.

Will opening an XLSM workbook in a browser delete its macros?

Opening it in Excel for the web does not by itself mean the VBA project is deleted. However, VBA cannot run there, and advanced features may have browser limitations. Use desktop Excel for the full workflow and keep the file in .xlsm format.

Can several people edit a shared XLSM workbook at the same time?

Co-authoring can be available for .xlsm files stored on OneDrive or SharePoint when participants use supported Excel versions and the workbook meets co-authoring requirements. Browser participants still cannot run VBA. Avoid editing VBA code while others are co-authoring, and test macros that modify shared data before relying on simultaneous use.

Why do macros still fail after I download the workbook?

Excel may block macros because of the file's origin or your organization's security policy. The code may also require unavailable add-ins, local paths, or platform-specific components. Open the file in desktop Excel, review the security message, and contact your administrator if trusted macros are blocked.

Should I save the shared workbook as XLSX?

No, not if you need to retain VBA. The .xlsx format cannot store VBA macros. In desktop Excel, use File > Save As and select Excel Macro-Enabled Workbook (*.xlsm).