Why Excel Macros Do Not Work in Shared OneDrive Files
Question details
The user needs to run macros and macro-driven controls in an Excel workbook shared through OneDrive.

- Product
- Microsoft Excel for the web and desktop Excel
- Device & OS
- not provided
- Scenario
- Coworkers open a shared OneDrive workbook containing VBA macros, timers, or buttons.
- Observed behavior
- Excel for the web cannot run VBA macros, and macro-driven controls may not display or work in the browser.
Confirm that you have the desktop Excel application installed and permission to access the shared OneDrive file. Check that the workbook is macro-enabled, typically with an .xlsm extension, and that you trust its source.
Open the Shared Workbook in Desktop Excel
Use desktop Excel to run VBA macros while keeping the workbook stored in OneDrive.
Open the OneDrive sharing link and select the workbook in Excel for the web.
Select Edit in Excel or Open in Desktop App from the workbook's editing or open menu.
If Excel displays a security warning, select Enable Content only if you trust the workbook and its source.
Use the workbook's button or other control, or open the Developer tab and select Macros to run an available macro.
Use Save or AutoSave in desktop Excel so changes are saved to the OneDrive workbook. Ask coworkers who need the macros to open the file in desktop Excel as well.

Work With Excel Files in WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for Microsoft Office formats, making it easy to move everyday workbook tasks to WPS. It does not fix Excel for the web's VBA limitation; check macro compatibility before relying on an existing VBA workbook.

Frequently Asked Questions
Can Excel for the web run VBA macros?
No. Open the workbook using Edit in Excel or Open in Desktop App to run VBA macros in desktop Excel.
Does the workbook have to leave OneDrive to run macros?
No. You can open the OneDrive workbook in desktop Excel and save changes back to the shared file.
Why does a workbook button not work in my browser?
The button may depend on a VBA macro or control that Excel for the web cannot run or display. Open the workbook in desktop Excel and enable macros only if you trust the file.
How can I enable macros in a trusted workbook?
After opening the workbook in desktop Excel, select Enable Content on the security warning if you trust the file and its source. Organization policies may restrict this option.




