Why does your workbook stop working when you open it in Excel Online? Why does that ‘Refresh Data’ button disappear after sharing via OneDrive? Why did your colleague swear their macro ran fine yesterday — only to find it grayed out today?
Quick Answer
No, Excel Online does not support VBA macros. If your workbook contains VBA (like a button tied to Module1.RunReport), those macros won’t execute — and the Developer tab won’t appear at all. But yes, Excel Online does support Power Automate flows, Excel JavaScript APIs, and pre-recorded Office Scripts — and some of these can replace up to 70% of common VBA use cases, especially data cleanup and report generation.
All the Methods
| Method | Steps | Best For | Limitations |
|---|---|---|---|
| VBA Macros | Open in desktop Excel → Alt+F11 → paste code → assign to shape | Complex logic, UI controls, legacy systems | ❌ Not supported in Excel Online. Disabled if file opened in browser. |
| Office Scripts | Home tab → Automate → Record Actions or Code Editor → Save → Run from ribbon | Repetitive formatting, filtering, copying ranges (e.g., B2:C10 → D2) | ⚠️ No loops over rows >10,000. No MsgBox or InputBox. Requires Microsoft 365 Business/Enterprise. |
| Power Automate + Excel Online | Create flow → Trigger on file change → Use ‘Get rows’ → Apply condition → ‘Update row’ | Scheduled tasks (e.g., daily sales summary), cross-app automation | ⚠️ Requires SharePoint/OneDrive folder setup. No real-time triggers for cell edits. |
| Excel JavaScript API (Custom Functions) | Build manifest → Deploy via AppSource or sideload → Use =MYFUNCTION(A1) in sheet | Reusable calculations (e.g., =NETPAY(B2, C2)) across workbooks | ⚠️ Requires dev skills. Not editable by end users. Approval needed for org-wide rollout. |
| Pre-built Templates with Formulas | Use LET(), SEQUENCE(), FILTER() to auto-generate reports in real time | Dashboard updates, dynamic lists, conditional summaries | ⚠️ Won’t modify cells outside formula scope. Can’t trigger on button click. |
Method 1 Deep Dive
Let’s say your team uses a workbook called Sales_Q3_Report.xlsx to clean raw data from Salesforce. In desktop Excel, you had a macro that:
- Selected range A2:E500
- Deleted rows where column D = “Pending”
- Formatted column E as currency
- Added a timestamp in cell G1
You try opening it in Excel Online — and the ‘Clean Report’ button is just… gone.
Here’s how to rebuild that logic using Office Scripts:
- Open Sales_Q3_Report.xlsx in Excel Online
- Go to Home → Automate → Record Actions
- Select A2:E500 → Right-click → Filter → Filter by ‘Status’ → Uncheck ‘Pending’
- Select column E → Home → Number Format → Currency
- Type
=NOW()in G1 → Press Enter - Click ‘Stop Recording’, name it “Clean Q3 Report”, and save
The script saves to your OneDrive under My Scripts. Next time, anyone with edit access clicks Automate → Clean Q3 Report. It runs instantly — no desktop required.
Surprising tip: Office Scripts *can* read cell values but cannot write to cells outside the active worksheet. So if your old macro updated a Summary tab based on data in RawData tab, you’ll need two separate scripts — or switch to Power Automate.
Method 2 Deep Dive
Imagine Sarah Chen in Finance needs to email a PDF of the weekly P&L every Monday at 9 a.m. Her old VBA used Outlook.Application — impossible online.
Instead, she built a Power Automate flow that:
- Triggers every Monday at 9:00 AM (UTC+8)
- Gets rows from Excel Online table named
PnL_Weekly(in sheet ‘Data’, range B2:F47) - Filters for
[Week Ending] >= TODAY()-7 - Creates a PDF using ‘Convert table to PDF’ action
- Sends email to finance@acmecorp.com with attachment
She stored the Excel file in a SharePoint document library called Finance/Reports, not just personal OneDrive — because Power Automate needs consistent file location and permissions.
To set it up:
- Go to flow.microsoft.com
- Create new automated cloud flow → Schedule → Recurrence → Weekly → Monday 9:00
- Add ‘List rows present in a table’ → Choose site, library, file, table name
- Add ‘Filter array’ → Set condition:
item()?['Week Ending'] ge addDays(utcNow(), -7) - Add ‘Create PDF from HTML’ or use ‘Export Excel table to PDF’ (preview connector)
- Add ‘Send an email (V2)’ → Attach PDF output
It took her 22 minutes — and now it runs even when she’s on vacation. Bonus: She added a ‘Run now’ button so her manager can trigger it manually if needed.
Cheat Sheet
| Task | What Works in Excel Online | Keyboard Shortcut | Where to Find It |
|---|---|---|---|
| Run a recorded automation | Office Script | Alt+A, R (then select script) | Home → Automate |
| Edit a script | Office Script Editor | Alt+A, E | Home → Automate → Code Editor |
| Trigger scheduled action | Power Automate flow | N/A (web-based) | flow.microsoft.com → My flows |
| Insert dynamic date/time | =NOW() or =TODAY() | Ctrl+; (date), Ctrl+Shift+; (time) | Formula bar |
| Auto-filter visible rows | FILTER() function | N/A | Type =FILTER(A2:D100, D2:D100="Closed") in empty cell |
| Check if VBA exists | Look for Developer tab | Alt+D (won’t open anything) | Ribbon — if missing, VBA isn’t loaded |