Excel VBA vs. Office Scripts, Power Query, and DAX: Which Should You Use?
Question details
Choose an Excel tool for a database-style solution with data selection and filtering, and understand whether VBA is still supported.

- Product
- Microsoft Excel for Microsoft 365
- Device & OS
- not provided
- Scenario
- The user wants to build an Excel solution in which people interact with data through selections, filters, and potentially a graphical interface.
- Observed behavior
- The goal is to choose a supported tool that fits the deployment environment and the required interface, automation, and data modeling tasks.
Decide whether users will work in desktop Excel or Excel for the web, and list whether the solution needs a custom interface, data imports, or calculations. Check which features are available in your Excel version and Microsoft 365 subscription.
Use VBA for a Desktop Excel Interface and Automation
Choose VBA when users need a desktop workbook with custom forms, controls, or existing macro-based workflows.
VBA remains supported in desktop Excel for Windows and Mac, but it does not run in Excel for the web. Check platform compatibility if the workbook must run on both Windows and Mac.
In desktop Excel, open Developer > Visual Basic. If the Developer tab is hidden, enable it in Excel's ribbon settings.
In the Visual Basic editor, use Insert > UserForm to add a form, then add controls for the selections or filters users need.
Use File > Save As and choose an Excel Macro-Enabled Workbook (.xlsm). Reopen it in the target desktop Excel environment and test the form and macros.

Use Office Scripts for Excel Web Automation
Choose Office Scripts to automate supported workbook tasks when users work in Excel for the web instead of relying on VBA macros.
Use Power Query and DAX for Data Import and Modeling
Choose Power Query for importing and transforming data, and DAX measures in a data model for calculations and analysis.
Work With Excel-Compatible Spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface for opening and editing Excel files. Its format compatibility can help with migration, but it does not change Excel's VBA support or guarantee that Excel-specific automation and data models will work unchanged.

Frequently Asked Questions
Is VBA still supported in Microsoft 365 Excel?
Yes. VBA remains supported in desktop Excel for Windows and Mac. It does not run in Excel for the web, and future support policies can change.
Can Office Scripts replace a VBA UserForm?
Office Scripts can automate supported workbook actions, but they are not a direct replacement for VBA UserForms. For a custom desktop form, open Developer > Visual Basic in desktop Excel and use Insert > UserForm.
What is the difference between Power Query and DAX?
Power Query imports and transforms data using M. DAX creates calculations, such as measures, in a data model. Start an import with Data > Get Data, then use Power Pivot for model calculations where available.
Can I combine these tools in one Excel solution?
Yes. For example, use Data > Get Data to import and transform records, create DAX measures in a supported Data Model, and use VBA in desktop Excel for a custom interface. Test the combination in each target Excel environment.
What file type should I use for a VBA workbook?
In desktop Excel, use File > Save As and select Excel Macro-Enabled Workbook (.xlsm) to retain VBA code. Users must open it in desktop Excel to run its macros.




