Can You Run Excel Macros from a Button in Excel 365 on Android?
Question details
The user wants to execute an Excel macro by tapping a form control button on an Android device to export a specific print area as a JPG or PDF file.

- Product
- Microsoft Excel 365
- Device & OS
- Android
- Scenario
- Attempting to automate the export of a specific spreadsheet print area to an image or PDF using VBA-linked form controls on a mobile device.
- Observed behavior
- The form control button is unresponsive, and the VBA macro fails to run because the Excel mobile app does not support executing macros natively.
Verify whether your automation relies on standard VBA code, as Microsoft Excel for Android and iOS inherently lacks the architecture to run Visual Basic for Applications (VBA).
Use Desktop Excel to Run the VBA Macro
Since the Excel for Android app lacks VBA support, the most direct solution is to execute the macro on a Windows or Mac desktop computer where VBA is fully supported.
VBA (Visual Basic for Applications) requires the Windows or Mac desktop environment to function. Any macro buttons embedded in your spreadsheet will be disabled when opened on mobile devices.
Transfer or sync the .xlsm workbook to a Windows or Mac computer and open it with the desktop version of Microsoft Excel.
Click 'Enable Content' in the yellow security warning bar at the top of the screen to allow VBA macros to run.
Click the macro-enabled button in your spreadsheet to automatically save the defined print area as a JPG or PDF file as intended.

Manually Export as PDF on Android
If you must perform the task from your Android device, you can bypass the macro entirely and use Excel's native mobile features to export the sheet to PDF.
Use Power Automate for Cloud Workflows
For Microsoft 365 users who need mobile automation, Power Automate can serve as a cloud-based alternative to local VBA scripts.
Work with Spreadsheets Seamlessly Across Devices
While running VBA macros on mobile devices is a limitation of Microsoft Excel, WPS Office provides a lightweight, highly compatible, and free alternative. Enjoy built-in PDF export tools that work flawlessly on both desktop and mobile platforms.
- 1. Download WPS Office: Install WPS Office on your desktop or mobile device from the official website or app store.
- 2. Open your spreadsheet: Launch your .xlsx or .xlsm file effortlessly with high compatibility.
- 3. Export to PDF: Use the built-in 'Export to PDF' tool located in the main toolbar to quickly save your print area without needing complex macros.

Frequently Asked Questions
Why do my Excel macro buttons not work on Android?
Microsoft Excel for Android and iOS does not include the Visual Basic for Applications (VBA) engine required to execute macros. Consequently, any form control buttons linked to VBA code will be disabled or unresponsive when tapped.
Can I use Office Scripts instead of VBA on mobile?
Yes. If you have an eligible Microsoft 365 commercial or educational plan, you can write Office Scripts (based on TypeScript) which can be executed from the Excel mobile app, unlike traditional VBA macros.
How do I save an Excel sheet as an image on Android?
To save an Excel sheet as an image without a macro, take a screenshot of the desired area on your Android device. Alternatively, you can copy the cells, paste them into a note or presentation app as an image, and save it to your gallery.




