logo
search
VBA & Macro Problems

Can You Run Excel Macros from a Button in Excel 365 on Android?

Huma Ashraf ChHuma Ashraf Ch Oct 20, 2026 868 views

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.

Can You Run Excel Macros from a Button in Excel 365 on Android?
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.
Before you start

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).

Solution 1Recommended

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.

1
Open the workbook on a desktop

Transfer or sync the .xlsm workbook to a Windows or Mac computer and open it with the desktop version of Microsoft Excel.

2
Enable macros

Click 'Enable Content' in the yellow security warning bar at the top of the screen to allow VBA macros to run.

3
Click the form control button

Click the macro-enabled button in your spreadsheet to automatically save the defined print area as a JPG or PDF file as intended.

Use Desktop Excel to Run the VBA Macro
Macro Security: Ensure your Excel Trust Center settings on the desktop allow macros to run, otherwise the button will remain unresponsive even on PC.
Free Microsoft Office alternative

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. 1. Download WPS Office: Install WPS Office on your desktop or mobile device from the official website or app store.
  2. 2. Open your spreadsheet: Launch your .xlsx or .xlsm file effortlessly with high compatibility.
  3. 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.
Completely free and lightweight office suiteHigh compatibility with Microsoft Office formats, including .xlsx and .xlsmBuilt-in mobile tools to effortlessly export spreadsheets as PDFsFamiliar user interface for a smooth and seamless transition
microsoft office alternative - wps office

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.