logo
search
VBA & Macro Problems

How to Edit Excel VBA Macros in a Shared Online Workbook

Maira MehtabMaira Mehtab Oct 22, 2026 868 views

Question details

The user needs to know how to create, edit, or run VBA macros within an Excel workbook that is shared online via OneDrive or SharePoint.

How to Edit Excel VBA Macros in a Shared Online Workbook
Product
Microsoft Excel
Device & OS
not provided
Scenario
Collaborating on macro-enabled workbooks (.xlsm) stored in a cloud environment like OneDrive or SharePoint.
Observed behavior
While workbook data can be edited seamlessly in Excel for the Web, VBA macros cannot be viewed or executed in the browser and must be managed through the desktop application.
Before you start

Ensure that your shared file is saved in the macro-enabled workbook format (.xlsm) and that you have the Microsoft Excel desktop application installed on your computer, as web versions do not support VBA editing.

Solution 1Recommended

Use Excel Desktop App for Shared VBA Workbooks

Since Excel for the Web cannot process VBA, you must open the shared cloud file in the desktop app to modify macro code.

Excel for the Web is excellent for real-time data entry and basic formatting, but it lacks the backend support required to run or edit Visual Basic for Applications (VBA).

To maintain your macros, the file can remain in the cloud, but the actual editing must take place in the full desktop client.

1
Save to the Cloud

Ensure your macro-enabled workbook (.xlsm) is uploaded to your OneDrive or SharePoint document library.

2
Share with Collaborators

Click the 'Share' button in your cloud drive interface to invite team members to collaborate on the file.

3
Open in Desktop App

When viewing the file in Excel for the Web, click the 'Viewing' or 'Editing' dropdown menu on the ribbon, and select 'Open in Desktop App' to launch the full Excel client.

4
Edit VBA Macros

Once the workbook opens in the desktop application, press Alt + F11 to open the VBA Editor. You can now create, modify, or run your macros while your changes continue to sync to the cloud.

Use Excel Desktop App for Shared VBA Workbooks
Co-authoring Limitations: While multiple users can edit standard spreadsheet cells simultaneously, VBA code editing requires exclusive access. Coordinate with your team to ensure only one person is editing the VBA macros at a time.
Free Microsoft Office alternative

Try WPS Office for Macro-Enabled Spreadsheets

If you need a reliable desktop application to handle VBA macros and complex spreadsheet tasks without heavy subscriptions, WPS Office is an excellent choice. It offers high compatibility with Microsoft formats and provides a lightweight, familiar interface.

Fully compatible with Microsoft Excel .xlsx and .xlsm formatsRobust support for VBA macros in the desktop applicationLightweight software that runs smoothly on most operating systemsFamiliar user interface ensuring a seamless migration process
microsoft office alternative - wps office

Frequently Asked Questions

Can I run VBA macros in Excel for the Web?

No, Excel for the Web does not support running, creating, or editing VBA macros. You must open the workbook in the Excel desktop application to utilize macro functionalities.

Will my macros be deleted if someone edits the file in Excel for the Web?

No, VBA macros are preserved in the background when a macro-enabled workbook is opened and edited in Excel for the Web, even though they cannot be executed or viewed directly in the browser.

How do I share a macro-enabled workbook (.xlsm)?

You can upload your .xlsm file to cloud services like OneDrive or SharePoint and use the standard 'Share' feature to generate a link or send direct email invitations to your collaborators.

Can multiple users edit VBA code simultaneously in a shared workbook?

Editing VBA code does not support real-time co-authoring. To prevent file conflicts and code corruption, only one user should access the VBA Editor in the desktop application at a time.