VBA & Macro Problems

Why Excel Macros Do Not Work in Shared OneDrive Files

Huda QurayshiHuda Qurayshi Nov 22, 2026 868 views

Question details

The user needs to run macros and macro-driven controls in an Excel workbook shared through OneDrive.

Why Excel Macros Do Not Work in Shared OneDrive Files
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.
Before you start

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.

Solution 1Recommended

Open the Shared Workbook in Desktop Excel

Use desktop Excel to run VBA macros while keeping the workbook stored in OneDrive.

1
Open the shared file

Open the OneDrive sharing link and select the workbook in Excel for the web.

2
Switch to desktop Excel

Select Edit in Excel or Open in Desktop App from the workbook's editing or open menu.

3
Enable trusted macros

If Excel displays a security warning, select Enable Content only if you trust the workbook and its source.

4
Run the macro

Use the workbook's button or other control, or open the Developer tab and select Macros to run an available macro.

5
Save your changes

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.

Open the Shared Workbook in Desktop Excel
Browser limitation: Keeping the workbook in OneDrive does not make VBA macros run in Excel for the web. Other users can view or edit supported workbook content in the browser, but they need desktop Excel to run VBA.
Free Microsoft Office alternative

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.

Open and edit spreadsheet data in a familiar interfaceWork with Microsoft Excel formats, including XLSX and XLSMUse a free, lightweight office suite for everyday workMove compatible Office documents into WPS for continued editing
microsoft office alternative - wps office

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.