How to Run VBA Macros When Using Excel for the Web
Question details
The user wants to know if they can create, record, run, or edit VBA macros using the web-based version of Excel.
- Product
- Excel for the Web
- Device & OS
- not provided
- Scenario
- Attempting to automate tasks, run existing VBA code, or find the Record Macro feature within the browser version of Excel.
- Observed behavior
- The Record Macro button is unavailable, and existing VBA macros cannot be executed or edited while working in Excel for the Web.
Verify that you have the desktop version of Microsoft Excel installed on your computer, as you will need it to actively run, record, or edit your VBA macros.
Open the Workbook in the Excel Desktop Application
Since Excel for the Web cannot execute VBA, you must switch to the desktop application to utilize your macro features.
Excel for the web preserves existing VBA macros in your workbook, but it lacks the backend engine to run, edit, or record them. Switching to the desktop version seamlessly bridges this functionality gap.
Look at the top of your Excel for the Web interface to find the main ribbon.
Click on the 'Viewing' or 'Editing' button, then select 'Open in Desktop App' from the dropdown menu.
If prompted by your web browser, click 'Always allow' or 'Open' to launch the Microsoft Excel desktop application.
Once the workbook opens on your desktop, navigate to the 'Developer' tab to record, run, or edit your VBA macros.

Use Office Scripts for Browser Automation
If you must work entirely within the browser and cannot use the desktop app, consider converting your automation needs to Office Scripts.
Run VBA Macros Seamlessly with WPS Office
If you are restricted by the limitations of web-based spreadsheet tools, WPS Office provides a robust desktop application that supports VBA macros natively. Enjoy a lightweight, highly compatible alternative to Microsoft Office that lets you run and edit your existing macros without hassle.

Frequently Asked Questions
Will I lose my macros if I edit a macro-enabled workbook in Excel for the Web?
No, Excel for the Web will preserve your existing VBA macros within the file. They simply remain inactive in the background while you edit the document's cells and formulas in the browser.
Can I automatically convert my existing VBA macros to Office Scripts?
Currently, there is no direct conversion tool to automatically change VBA code into Office Scripts. You will need to manually recreate your automation logic using TypeScript in the Office Scripts editor.
Why is the Record Macro button missing in Excel Online?
Excel Online (Excel for the Web) does not have a VBA engine built into its browser architecture. Because the environment cannot compile or execute Visual Basic, the Developer tab and the Record Macro button are intentionally hidden.




