What Most People Miss About Excel Online and Macros

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

MethodStepsBest ForLimitations
VBA MacrosOpen in desktop Excel → Alt+F11 → paste code → assign to shapeComplex logic, UI controls, legacy systems❌ Not supported in Excel Online. Disabled if file opened in browser.
Office ScriptsHome tab → Automate → Record Actions or Code Editor → Save → Run from ribbonRepetitive 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 OnlineCreate 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 sheetReusable 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 FormulasUse LET(), SEQUENCE(), FILTER() to auto-generate reports in real timeDashboard 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:

  1. Open Sales_Q3_Report.xlsx in Excel Online
  2. Go to Home → Automate → Record Actions
  3. Select A2:E500 → Right-click → Filter → Filter by ‘Status’ → Uncheck ‘Pending’
  4. Select column E → Home → Number Format → Currency
  5. Type =NOW() in G1 → Press Enter
  6. 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:

  1. Go to flow.microsoft.com
  2. Create new automated cloud flow → Schedule → Recurrence → Weekly → Monday 9:00
  3. Add ‘List rows present in a table’ → Choose site, library, file, table name
  4. Add ‘Filter array’ → Set condition: item()?['Week Ending'] ge addDays(utcNow(), -7)
  5. Add ‘Create PDF from HTML’ or use ‘Export Excel table to PDF’ (preview connector)
  6. 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

TaskWhat Works in Excel OnlineKeyboard ShortcutWhere to Find It
Run a recorded automationOffice ScriptAlt+A, R (then select script)Home → Automate
Edit a scriptOffice Script EditorAlt+A, EHome → Automate → Code Editor
Trigger scheduled actionPower Automate flowN/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 rowsFILTER() functionN/AType =FILTER(A2:D100, D2:D100="Closed") in empty cell
Check if VBA existsLook for Developer tabAlt+D (won’t open anything)Ribbon — if missing, VBA isn’t loaded
Tom Bradley

Tom Bradley

Tom has 15 years of experience in office management and supply chain optimization. He shares practical tips for running efficient workplaces.