Differences between Office Scripts and VBA macros
Office Scripts and VBA macros have a lot in common. They both allow users to automate solutions through an easy-to-use action recorder and allow edits of those recordings. Both frameworks are designed to empower people who may not consider themselves programmers to create small programs in Excel.
The fundamental difference is that VBA macros are developed for desktop solutions and Office Scripts are designed for secure, cross-platform, cloud-based solutions.
This article describes the main differences between VBA macros (as well as VBA in general) and Office Scripts. Since Office Scripts are only available for Excel, that is the only host being discussed here.
Platform and ecosystem
The following table shows which features are supported by which platforms and products.
|Excel on the web||Excel for Windows||Excel for Mac||Excel for iOS||Other Office products||Power Automate|
|Office Scripts Action Recorder||Yes||Yes||Yes||No||No||No|
Users require an enterprise or educational license to use or create Office Scripts. For the full list of supported licenses, see Platform support. VBA is built-in to the desktop versions of Excel and requires no special licensing.
Admins have three options for VBA macros: allow all macros on the tenant, allow no macros on the tenant, or allow only macros with signed certificates. This lack of granularity makes it hard to isolate a single bad actor. Currently, Office Scripts can be off for an entire tenant, on for an entire tenant, or on for a group of users in a tenant. Admins also have control over who can share scripts with others and who can use scripts in Power Automate.
Office Scripts don't support Excel-level events. Scripts are only run when a user manually starts them or when a Power Automate flow calls the script.
VBA doesn't have a Power Automate connector. All supported VBA scenarios involve a user attending to the macro's execution.
Office Scripts can be run through Power Automate. Your workbook can be updated through scheduled or event-driven flows, letting you automate workflows without even opening Excel. Try Tutorial: Update a spreadsheet from a Power Automate flow to start learning about Power Automate. You can also check out the Automated task reminders sample to see Office Scripts connected to Teams through Power Automate in a real-world scenario.