logo
search
VBA & Macro Problems

Fix Excel VBA Macros Not Working After Uploading to OneDrive

Guest WriterGuest Writer Oct 1, 2026 869 views

Question details

Users are unable to run Excel VBA macros after uploading their workbooks to OneDrive and opening them in the browser.

How to Fix Excel VBA Macros Not Working After Uploading to OneDrive
Product
Microsoft Excel, OneDrive
Device & OS
not provided
Scenario
Attempting to execute VBA macros in an Excel workbook hosted on OneDrive or accessed via Excel for the Web.
Observed behavior
The VBA macros do not run or trigger errors because browser-based Excel environments do not support desktop VBA execution.
Before you start

Verify that your workbook is saved in the .xlsm (Macro-Enabled Workbook) format before proceeding with these solutions.

Solution 1Recommended

Open the Workbook in the Excel Desktop Application

The quickest way to run your macros is to bypass the web browser and open the file directly in the desktop app, which fully supports VBA.

Excel for the Web does not support the execution of VBA macros. To utilize your existing VBA code, you must launch the file using the full desktop version of Excel.

1
Open Excel for the Web

Navigate to your OneDrive and open the macro-enabled workbook in your web browser.

2
Launch Desktop App

Click on the 'Viewing' or 'Editing' dropdown menu on the top ribbon, and select 'Open in Desktop App'.

3
Enable Content

Once the file opens in the Excel Desktop application, click 'Enable Content' in the yellow security warning bar at the top to allow your macros to run.

Open the Workbook in the Excel Desktop Application
Macro execution restored: Any changes made by the macros in the desktop application will still automatically sync back to OneDrive.
Free Microsoft Office alternative

Try WPS Office for Seamless VBA Macro Execution

If you are frustrated by macro limitations in browser-based tools, switch to WPS Office. It provides a lightweight, highly compatible desktop environment that fully supports Microsoft Office formats and VBA macros without forcing you into restrictive cloud environments.

  1. 1. Download WPS Office: Visit the official WPS website to download and install the free desktop suite on your computer.
  2. 2. Open Your Workbook: Launch WPS Spreadsheets and open your .xlsm file directly from your local drive or synced folder.
  3. 3. Enable Macros: Click 'Enable Macros' if prompted by the security warning, and run your VBA scripts seamlessly.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) formats.Robust desktop environment with built-in support for VBA macros and advanced data automation.Lightweight software that installs quickly and runs smoothly even on older devices.Familiar user interface with zero learning curve for existing Excel users.
QA img-9

Frequently Asked Questions

Why do my VBA macros work on my desktop but not on OneDrive?

VBA macros rely on the local desktop operating system's architecture to execute code. Excel for the Web, which is used when opening files from OneDrive in a browser, does not have the underlying framework to process VBA.

Can I run macros in Excel for the Web at all?

No, Excel for the Web cannot run standard VBA macros. You must either open the workbook in the desktop version of Excel or rebuild your automation using Office Scripts, which is supported in the browser.

Will I lose my macros if I upload the file to OneDrive?

No, uploading a macro-enabled workbook (.xlsm) to OneDrive does not delete the macros. They remain safely stored inside the file; they simply cannot be executed while you are viewing the file in the web browser interface.