Files Excel with macros (extension .xlsm) are an integral part of the work of accountants, analysts and managers. However, their discovery faces serious limitations: standard applications like Android their discovery faces serious limitations: standard applications like Google Sheets or Microsoft Excel Mobile block the execution of VBA code for security reasons. In this article, we will look at how to bypass the restrictions, which applications support macros on a smartphone, and what to do if none of the methods work.
It is important to understand: Android does not have full support for VBA macros due to architectural limitations of the operating system. Even the official application Excel from Microsoft allows you to only view macro code, but not execute it. However, there are workarounds, from Windows emulation to using cloud services. We tested 5 working methods and collected them in this instruction with step-by-step screenshots and risk warnings.
If you need not just to open a file, but specifically run macros โbe prepared to make compromises: either sacrifice convenience (emulators) or security (third-party APKs). For most users, the optimal solution will be a combination of cloud editing and manual data transfer. But first things first.
Why Android does not support macros in Excel
The reason lies in three key factors:
- ๐ Security: VBA scripts may contain malicious code, and the Android sandbox is not designed for isolation such processes.
- ๐ฅ๏ธ Architecture: Macros in Excel work through Windows API, which is not available on Android. Emulation requires a virtual machine.
- ๐ฑ Limitations of mobile applications: Even Excel Mobile is a stripped-down version of desktop software without VBA support.
Microsoft officially declares that macros on mobile devices are not supported, including iOS. This is not a whim of the developers, but a consequence of technical limitations. For example, a macro that interacts with the file system (Dir, FileCopy) simply has no analogues in the Android environment.
Moreover, even if there was support, the performance of smartphones rarely allows you to comfortably work with complex scripts. For example, a macro that processes 10,000 lines will take 5-10 times longer to execute on an average Android device than on a PC.
โ ๏ธ Attention: Any method of running macros on Android requires disabling some security systems. Do not open files from unknown sources - the risk of malware infection is higher than on a PC. Method 1: Cloud services (Excel Online + OneDrive) The safest, but limited method is to use a browser. It does not execute macros directly, but allows you to: .xlsm from unknown sources - the risk of malware infection is higher than on a PC.
Method 1: Cloud services (Excel Online + OneDrive)
The safest but limited method is to use Excel Online via browser. It doesn't execute macros directly, but it does allow:
- View VBA code (without running it).
- Edit data and save changes.
- Use Power Query for partial automation.
Instructions:
- Download the file
.xlsmto OneDrive or SharePoint. - Open it through a browser (we recommend Chrome or Edge).
- Click
View โ Show VBA code(available only in the desktop version of the site). - Copy the macro code and paste it into the desktop version of Excel for execution.
Disadvantages of the method:
- โ No macro execution on the device.
- โ Limited editing functionality.
- โ Requires stable Internet.
If the macro is simple (for example, formatting cells), try reproducing its actions manually in Google Sheets using Apps ScriptThis is an analogue of VBA for Android.
Method 2: Windows emulators (ExaGear, Wine)
To run a full Microsoft Excel with macro support you will need emulator Windows. On Android there are two working options:
| Emulator | Excel support | Setting up complexity | Performance |
|---|---|---|---|
| ExaGear (x86) | Excel 2010โ2016 | Average | Acceptable (on Snapdragon 8+) |
| Wine (via UserLAnd) | Excel 2003โ2007 | High | Low (lags with macros) |
| QEMU (full virtualization) | Any version | Very high | Extremely low |
Step-by-step guide for ExaGear (the most stable version):
Download APK from the official website (registration required)|Install Debian via Linux Deploy|Install Wine and Excel 2010 in Debian|Set up Android file sharing|Run Excel via wine
-->
Warnings:
- ๐จ Emulators consume up to 3โ4 GB of RAM and quickly drain the battery.
- ๐จ ExaGear paid (about $20) and has not been updated since 2018.
- ๐จ Macros will work in 5โ10 times slowerthan on a PC.
โ ๏ธ Attention: Emulators bypass Android protection, which can lead to antivirus blocking the device. Before installation, disable Google Play Protect in the security settings.
Method 3: Alternative applications (AndrOpen Office, Collabora)
Several Android applications claim to support macros, but in practice their functionality is extremely limited. We tested the three most popular:
- ๐ AndrOpen Office: Opens
.xlsm, but ignores macros. Suitable only for viewing data. - ๐ Collabora Office: Analogue LibreOffice for mobile. Does not execute macros, but saves their code when editing.
- ๐ Polaris Office: Blocks files with macros as โpotentially dangerousโ.
The only application that partially supports macros is WPS Office (Android version). It can:
- ๐น Show VBA code (without execution).
- ๐น Save files
.xlsmwithout losing macros. - ๐น Run simple scripts via WPS Cloud (requires subscription).
Instructions for WPS Office:
- Install the application from Google Play.
- Open the file
.xlsmand confirm unlocking macros. - Click
Tools โ Macros โ View Code. - To execute, copy the code and use WPS Cloud on PC.
Microsoft Excel|Google Sheets|WPS Office|OnlyOffice|Other-->
Method 4: Remote access to PC (TeamViewer, AnyDesk)
If you need work regularly with macros, the most reliable way is remote access to a desktop PC. Advantages:
- โ Full VBA support without restrictions.
- โ Security (files do not leave your PC).
- โ Performance (macros run at full capacity PC).
Instructions for TeamViewer:
- Install TeamViewer on PC and Android.
- On PC, enable autorun Excel in the background (
Options โ Autoload). - Connect from your smartphone to your PC via the app.
- Open the file
.xlsmon your PC and manage it from your phone.
For convenience:
- ๐ง Use View Only modeif you just need to check the results of the macro.
- ๐ง Set up
hot keysin TeamViewer for quick access to Excel. - ๐ง To save traffic, reduce
image qualityin the connection settings.
โ ๏ธ Attention: When accessing remotely via mobile data (4G/5G), macros may run slower due to network delays. For critical tasks, use Wi-Fi.
Method 5: Converting macros to Google Apps Script
If your macro performs simple actions (formulas, formatting, importing data), you can transfer it to Google Sheets s using Apps Script. This is an analogue of VBA for Android that runs in the cloud.
Replacement examples:
| Action in VBA | Analogue in Apps Script |
|---|---|
Range("A1").Value = "Hello" |
Sheet.getRange("A1").setValue("Hello"); |
Workbooks.Open("file.xlsx") |
SpreadsheetApp.openById("File_ID") |
Cells(1,1).Font.Bold = True |
Sheet.getRange("A1").setFontWeight("bold"); |
How to transfer a macro:
- Open the file
.xlsmin desktop Excel and copy the VBA code. - Create a new one Google Sheets and open
Extensions โ Apps Script. - Paste the code, replacing the syntax according to the table above.
- Save and run the script through the menu
Run.
Limitations:
- โ No support
UserForms(VBA forms). - โ Works slower with large data.
- โ Requires knowledge of JavaScript.
Example of converting VBA to Apps Script
Original VBA:
Sub FormatTable()
Range("A1:D10").Borders.Weight = xlThin
Range("A1:D1").Font.Bold = True
End Sub
Apps Script equivalent:
function formatTable() {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("A1:D10").setBorder(true, true, true, true, false, false, "black", SpreadsheetApp.BorderStyle.SOLID_THICK);
sheet.getRange("A1:D1").setFontWeight("bold");
}
What to do if no method works
If your macro:
- ๐น Uses
Windows API(for example,Shell,Declare Function). - ๐น Interacts with external devices (printers, COM ports).
- ๐น Requires
ActiveXor.dll-libraries.
... then it it is impossible to run on Android without a full-fledged PC In such cases:
- Break the macro into parts: Run on the PC the part that requires Windows, and transfer the rest to Google Sheets.
- Use web services: For example, Zapier or Make (ex-Integromat) for automation without VBA.
- Ask the developer: Rewrite the macro on
Python(can be run via Pydroid 3 on Android).
For urgent tasks:
- ๐ฑ Send file to a colleague from a PC by mail.
- ๐ฑ Use remote desktop via Chrome Remote Desktop.
- ๐ฑ Rent a virtual PC (for example, AWS WorkSpaces) for $10โ15 per month.
If the macro is critical for operation, the only thing A reliable solution is to use a PC or laptop. Android is not designed for professional work with VBA, and all workarounds are temporary crutches.
FAQ: Frequently asked questions about macros on Android
Is it possible to open XLSM on Android without the Internet?
Yes, but only to view data. WPS Office or AndrOpen Officeis suitable for this. However, macros will not be executed. Offline editing with macros requires a Windows emulator (for example ExaGear), but it requires prior setup on a PC.
Why doesn't Excel Mobile support macros?
Microsoft deliberately disabled this feature due to security risks and technical limitations. VBA macros can contain malicious code, and mobile devices do not have sufficient isolation mechanisms to safely execute such scripts. In addition, macros often use Windows features that are not available on Android.
How to protect an XLSM file when opening on Android?
If you need to transfer a file with macros to Android, but are afraid of changes:
- Save a copy in format
.xlsb(binary Excel, supports macros, but more difficult to edit). - Password the VBA project: in Excel, click
Alt + F11 โ Tools โ VBAProject Properties โ Protection. - Use OneDrive with versioning to roll back changes.
Are there free Windows emulators for Android?
Free solutions (Wine, QEMU) are either extremely unstable or require deep technical knowledge. For example, UserLAnd allows you to run Wine in a Linux container, but the performance will not be sufficient for Excel with macros. For stable operation you will need a paid one ExaGear or renting a cloud PC.
Is it possible to run a macro on Android via Termux?
Theoretically yes, but this requires:
- Installation Termux i proot-distro with Ubuntu.
- Settings Wine i Excel 2007 in the container.
- Manually setting up the X server for the graphical interface.
In practice, this method only works on flagship devices (Snapdragon 8 Gen 2+) and takes up 5โ8 GB of space. It is easier to use remote access to a PC.