logo
search
VBA & Macro Problems

Why Excel VBA Macros Do Not Work in SharePoint or Excel for the Web

Emma BrownEmma Brown Oct 23, 2026 869 views

Question details

The user is unable to run VBA macros when opening Excel workbooks through SharePoint browser views or Excel for the Web.

Why Excel VBA Macros Do Not Work in SharePoint or Excel for the Web
Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to execute VBA code, automate tasks, or use features like active-row highlighting while viewing or editing a spreadsheet in a web browser.
Observed behavior
The VBA macros do not run, and the browser-based version of Excel indicates that macros are unsupported.
Before you start

Ensure you have a desktop spreadsheet application installed on your computer, as browser-based environments do not contain the runtime engine required to execute VBA code.

Solution 1Recommended

Open the Workbook in the Excel Desktop Application

The most effective way to use VBA macros stored in SharePoint is to launch the file directly in your local desktop application.

VBA (Visual Basic for Applications) relies on local system architecture and Windows-based components that web browsers cannot access. To use your automated scripts, the file must be routed from the web interface to the desktop client.

1
Open the file in your browser

Navigate to your SharePoint document library and open the macro-enabled workbook (.xlsm) in Excel for the Web.

2
Locate the Editing menu

Look for the 'Viewing' or 'Editing' dropdown menu near the center or right side of the top ribbon.

3
Select Open in Desktop App

Click on 'Open in Desktop App'. When prompted by your web browser, confirm that you want to open Microsoft Excel.

4
Enable macro content

Once the file opens in the desktop application, click 'Enable Content' in the yellow security warning bar to allow your VBA macros to run normally.

Open the Workbook in the Excel Desktop Application
Macro Functionality Restored: Any changes made in the desktop app will automatically sync back to SharePoint if AutoSave is enabled.
Free Microsoft Office alternative

Use WPS Office Desktop for Reliable Macro Execution

Since Excel for the Web does not support VBA macros, switching to a capable desktop suite is a practical solution. WPS Office is a lightweight, highly compatible alternative that natively handles standard Office files and allows you to run VBA macros efficiently on your local machine.

  1. 1. Download WPS Office: Visit the official WPS website and install the free WPS Office suite on your local computer.
  2. 2. Open your macro-enabled workbook: Launch WPS Spreadsheet and open your .xlsm file that contains the automated scripts.
  3. 3. Execute your macros: Enable macros when prompted and run your automated tasks seamlessly without browser limitations.
Free and lightweight desktop applicationFully compatible with Microsoft Excel formats (.xls, .xlsx, .xlsm)Familiar user interface with zero learning curveRobust local environment for complex spreadsheet automation and VBA macros
microsoft office alternative - wps office

Frequently Asked Questions

Why do my macros work on my desktop but not in SharePoint?

SharePoint relies on Excel for the Web to display workbooks in your browser. This web-based environment lacks the necessary Windows-based VBA runtime engine required to execute macro code.

Will saving a macro-enabled workbook to SharePoint delete the macros?

No, uploading or editing an .xlsm file in SharePoint or Excel for the Web will not delete your existing VBA code. The macros simply remain dormant and will function normally once you open the workbook again in a compatible desktop app.

Why is the 'Open in Desktop App' button missing in SharePoint?

This usually happens if your organization's SharePoint administrator has restricted the ability to open files in local client applications, or if the device you are using does not have a recognized desktop Office suite installed.