logo
search
VBA & Macro Problems

How to Enable VBA Macros in Excel Files Shared via OneDrive

Algirdas JasaitisAlgirdas Jasaitis Oct 9, 2026 869 views

Question details

Users need to enable VBA macros for Excel workbooks shared via OneDrive, which frequently trigger macro-disabled warnings.

How to Enable VBA Macros in Excel Files Shared Through OneDrive
Product
Microsoft Excel
Device & OS
not provided
Scenario
Accessing and running VBA macros in a shared Excel file (.xlsm) synchronized through OneDrive.
Observed behavior
A macros-disabled security warning appears, preventing the VBA code from executing, even if the creator originally enabled macros on their own computer.
Before you start

Verify that the shared Excel file comes from a trusted source, as enabling macros can expose your computer to malicious code if the workbook is not secure.

Solution 1Recommended

Configure Excel Trust Center Settings for Macros

Modify the local Trust Center settings on each computer accessing the shared file to allow VBA macros to execute safely.

Macro security settings are configured separately on each user's local device, not within the Excel file itself. When sharing a macro-enabled workbook via OneDrive, every collaborator must adjust their local Excel application settings to permit the macros to run.

1
Open Excel Options

Launch Microsoft Excel, open the shared file from OneDrive, and click on File in the top-left corner. Select Options at the bottom of the menu.

2
Access Trust Center Settings

In the Excel Options dialog box, click on Trust Center in the left-hand navigation pane, then click the Trust Center Settings button on the right.

3
Adjust Macro Settings

Select Macro Settings from the left menu. Choose your desired security level, such as 'Enable all macros' (for trusted environments) or 'Disable all macros with notification'.

4
Trust VBA Project Object Model

Check the box next to 'Trust access to the VBA project object model' if your shared macros need to interact with the VBA environment itself.

5
Apply Settings to All Affected Computers

Click OK to save your changes. You must repeat this exact configuration process on every user's computer that needs to run the macros in the shared OneDrive file.

Configure Excel Trust Center Settings for Macros
Security Recommendation: Selecting 'Enable all macros' removes security alerts for all files. If you only want to trust specific files, consider using Trusted Locations instead of lowering your global macro security level.
Free Microsoft Office alternative

Try WPS Office for Seamless Macro and Spreadsheet Management

If you frequently encounter macro security issues or sync warnings in Microsoft Excel, consider switching to WPS Office. It provides robust spreadsheet capabilities, an intuitive interface, and excellent compatibility with Microsoft formats.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package.
  2. 2. Install WPS Office: Run the installer and follow the on-screen instructions to set up the software on your device.
  3. 3. Open Your Spreadsheets: Launch WPS Spreadsheet and easily open your macro-enabled workbooks with full format compatibility.
Free and lightweight Office suite for everyday tasksHigh compatibility with Microsoft Excel formats (.xlsx, .xlsm)Built-in support for VBA macros in WPS Spreadsheet (available in Professional versions)Familiar tabbed user interface for a seamless transition
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel macros work locally but not when shared on OneDrive?

Macro security settings are stored locally on your computer's registry, not embedded within the Excel file. When you share a file via OneDrive, other collaborators must also configure their local Excel Trust Center settings to allow macros to run.

Is it safe to select 'Enable all macros' in Excel's Trust Center?

Enabling all macros can expose your computer to malicious scripts. This setting is only recommended if you are absolutely certain that all files you open come from a trusted, verified source.

How can I trust a specific OneDrive folder without enabling all macros globally?

You can add your synced OneDrive folder to Excel's Trusted Locations. Go to File > Options > Trust Center > Trust Center Settings > Trusted Locations, click 'Add new location', and select the local path of your OneDrive sync folder.

Do I need to enable 'Trust access to the VBA project object model'?

You only need to enable this option if your VBA macro specifically contains code that manipulates the VBA environment itself (like adding or modifying other macros). Standard macros usually do not require this setting.