VBA & Macro Problems

How to Run a Word Macro Template from SharePoint Online

Adam DavisAdam Davis Oct 21, 2026 870 views

Question details

The user needs to easily run a macro-enabled Word template (.dotm) directly from a SharePoint Online communication site.

How to Run a Word Macro Template from SharePoint Online
Product
SharePoint Online
Device & OS
not provided
Scenario
Attempting to open and execute a macro-enabled Word template (.dotm) hosted on a SharePoint site with as few clicks as possible.
Observed behavior
Macros (such as AutoNew or AutoOpen) fail to trigger when the template is opened in Word for the web browser, although they function correctly in the desktop application.
Before you start

Ensure you have a desktop version of a word processor that supports VBA installed, as web browsers cannot execute macro code.

Solution 1Recommended

Open the Template in the Word Desktop Application

Bypass the browser limitations by opening the SharePoint file directly in the desktop app.

Word for the web allows viewing of macro-enabled templates (.dotm), but it is incapable of running VBA macros. To utilize user forms or automated scripts, the file must be opened natively on your desktop application.

1
Navigate to the file

Open your company's SharePoint communication site and locate the macro-enabled template in the document library.

2
Access the file menu

Click the three vertical dots (ellipsis) next to the template's file name to open the context menu.

3
Open in Desktop App

Select 'Open', then click on 'Open in app' (or 'Open in Desktop App') to launch the file in your local Word client.

4
Enable macro content

Once the application opens, click the 'Enable Content' button on the yellow security warning bar to allow the AutoOpen or AutoNew macros to run.

Default to Desktop App: SharePoint administrators can change the library's advanced settings to default 'Opening Documents in the Browser' to 'Open in the client application', saving users extra clicks.
Free Microsoft Office alternative

Run Macro-Enabled Documents with WPS Office

Since web browsers cannot run VBA macros, a robust desktop application is required. WPS Office offers a highly compatible alternative to Microsoft Word, supporting VBA macros and seamlessly handling .docm and .dotm formats for free.

  1. 1. Download the template: Download the macro-enabled template (.dotm) from SharePoint to your local computer.
  2. 2. Open WPS Writer: Launch the WPS Office desktop application and select WPS Writer.
  3. 3. Enable and run: Open the downloaded template. When prompted, enable macros to utilize the document's built-in automation features.
Fully compatible with Microsoft Word macro-enabled formats (.docm, .dotm)Built-in VBA editor for running and managing macros nativelyFree to download and lightweight on system resourcesFamiliar user interface ensuring a seamless migration
microsoft office alternative - wps office

Frequently Asked Questions

Why do my AutoNew macros fail in Word for the web?

Word for the web is built for basic document viewing and editing. It lacks the underlying architecture required to run VBA scripts, meaning macros like AutoNew or AutoOpen will only trigger in a desktop application.

Can I force SharePoint to always open files in the desktop app?

Yes. If you have administrator privileges, go to the Document Library Settings, click on Advanced Settings, and change the 'Opening Documents in the Browser' default setting to 'Open in the client application'.

Do macro-enabled templates work if shared via OneDrive?

The same browser limitations apply to OneDrive. Files opened in Word for the web via OneDrive will not run macros. You must open them in the desktop application to execute VBA code.