Excel VBA User-Defined Functions Not Working in Excel for the Web
Question details
Users need to know if VBA user-defined functions can run in Excel for the web and how to handle workbooks containing them online.

- Product
- Excel
- Device & OS
- Web, Android, iOS, Windows, macOS
- Scenario
- Opening and attempting to use an Excel workbook that contains custom VBA user-defined functions in a web browser or mobile application.
- Observed behavior
- The VBA user-defined functions execute perfectly in the desktop version of Excel but fail to work, return errors, or remain unsupported when the same file is opened in Excel for the web, Android, or iOS.
Verify whether you are currently accessing your workbook through a web browser, a mobile app, or a desktop application, as VBA execution capabilities are strictly limited to local desktop environments.
Open the Workbook in the Desktop Application
Since VBA is only supported on Windows and macOS desktop versions, transitioning your session from the web to the desktop app is the most straightforward fix.
Excel for the web cannot process Visual Basic for Applications (VBA) code. To utilize your custom functions, you must launch the file using the full desktop software.
While viewing your workbook in Excel for the web, locate the ribbon menu at the top of the screen.
Click the 'Viewing' or 'Editing' button on the ribbon, then select 'Open in Desktop App' from the dropdown menu to launch the file in your local Excel program.
Once the file opens in the desktop version, click 'Enable Content' in the yellow security warning bar to allow your VBA user-defined functions to run.

Replace VBA with Office Scripts or Standard Formulas
If you must work strictly within Excel for the web, rebuild your custom functions using supported native formulas or cloud-friendly Office Scripts.
Use WPS Office for Powerful VBA and Macro Support
If you need a reliable desktop solution to run complex VBA user-defined functions without the high subscription costs of Microsoft Office, WPS Office is a lightweight, highly compatible alternative that natively supports macros.
- 1. Download WPS Office: Visit the official WPS website and download the desktop version of WPS Office.
- 2. Open Your Macro File: Launch WPS Spreadsheets and open your .xlsm file containing the user-defined functions.
- 3. Enable and Run Macros: Accept the security prompt to enable macros, and your VBA functions will calculate just as they do in desktop Excel.

Frequently Asked Questions
Why does my Excel file show a macro warning in the web version?
Excel for the web cannot execute VBA macros. It will display a warning notifying you that the workbook contains macros and will require you to open the file in a desktop application to run that specific content.
Will Office Scripts entirely replace VBA in Excel?
Office Scripts are designed specifically for cloud-based automation in Excel for the web and work across mobile platforms. While they serve as a modern alternative to VBA for web users, VBA remains fully supported and heavily utilized in desktop versions of Excel.
Can I run Excel macros or user-defined functions on an iPad or Android tablet?
No, VBA macros and User-Defined Functions are strictly unsupported on iOS or Android versions of Excel. To use these functions, you must access the file using a Windows or macOS desktop computer.




