The macro lesson ends with an asterisk that grows larger every year: VBA doesn’t run in the browser. As workbooks move to OneDrive and co-authoring, the classic macro becomes a button that half your colleagues can’t press. Microsoft’s successor is Office Scripts — the same record-and-replay idea, rebuilt for the web era — and it comes with one capability VBA never had that quietly matters more than everything else.
Same recorder, new engine
In Excel on the web (or modern desktop), the Automate tab:
Record Actions, perform your ritual, stop, name it. Identical
workflow to the
macro recorder —
format the header, sort the
Table,
hide the workings — and the same rule applies: record calmly,
once, correctly.
The differences under the hood:
| VBA macro | Office Script | |
|---|---|---|
| Lives in | the .xlsm file | your cloud account (shareable) |
| Runs in | desktop only | browser + desktop |
| Language | VBA | TypeScript |
| Reach | anything, incl. your PC | the workbook, sandboxed |
| Can run unattended? | no | yes — Power Automate |
That “sandboxed” row is a feature in both directions: scripts
can’t touch your file system or registry, which kills a whole
class of macro-security fear — the browser prompt anxiety of
.xlsm attachments doesn’t exist here.
Reading what it wrote (déjà vu, better)
Automate → your script → Edit shows the recording as
TypeScript. As with VBA, you’re not required to become a
programmer — but the recorded code is noticeably cleaner to
read (worksheet.getRange("A1").getFormat().getFont().setBold(true)
— a sentence, if a verbose one), and small edits (changing a
literal, deleting a step) are the same gentle on-ramp. One
genuine improvement: scripts are typed, so the editor
underlines mistakes as you make them, before anything runs —
loud failure, brought
forward in time.
The capability VBA never had
A macro needs a human at the keyboard. An Office Script can be a step in a Power Automate flow — which means it runs unattended: on a schedule, or triggered by an event, against a workbook in the cloud, while nobody’s logged in.
That unlocks the endgame for the monthly-report pipeline this series keeps returning to: attachments file themselves, the script refreshes and tidies the workbook Monday at 07:00, the flow posts “report’s ready” to Teams — and the human contribution to the whole ritual is reading the answer. Every piece is visible, named, and fails loudly into the flow’s run history.
The honest boundaries
The rules from the macro lesson survive translation intact: scripts are for interface rituals and orchestration; data shaping still belongs to the recipe, calculations to formulas. Coverage has gaps VBA doesn’t — scripts can’t drive other applications, pop custom dialogs, or reach outside the workbook — so the deep VBA estates in legacy files aren’t going anywhere soon; the practical rule of thumb: new automation on shared cloud workbooks → script; desktop-only, file-touching, or inherited → macro stays. And scripts need work/school 365 — home licences currently watch from the sidelines.
The arc across these three automation lessons is worth noticing as the syllabus closes: record the ritual, read what was recorded, wire it to a trigger, and keep every moving part where eyes can find it. The tools will keep being renamed. The shape of good automation — visible, boring, loud when it breaks — apparently never changes.