Blog · 15 October 2026 · 7 min read

Excel Automation: Macro, Script, or Just Ask AI?

Excel automation now means three things: a recorded macro, an AI-written one, or an Office Script. Which fits a task, a worked example, and the checks first.

Name the range. Pick a shape. Check it first.

“Excel automation” covers three genuinely different things, and the right one depends on where the task lives, not on which sounds more advanced. A macro — recorded by hand or written by an AI tool — runs inside one workbook on one machine, triggered by a button or a keyboard shortcut. An Office Script, run through Power Automate, runs the same kind of logic in the cloud, works in Excel for the web, and can trigger on a schedule or an external event rather than a click. And for a task that only happens once or twice, there is no automation at all worth building — you just ask a chat tool for the one formula or transformation and move on. Picking the wrong one of these three is the most common way an “automation” project turns into more maintenance than the manual task ever was. General-purpose models have got measurably better at exactly this kind of structured, syntax-heavy output, tracked year over year by the Stanford AI Index — which is also why the temptation to skip straight to the most capable-sounding option, rather than the smallest one that fits, is stronger than it used to be.

The three shapes, and when each one fits

  • A macro fits a task that lives entirely inside one workbook, is triggered by a person clicking something, and does not need to run anywhere Excel is not already open. A macro generator for Excel covers the recorder versus AI-written VBA choice in detail.
  • An Office Script fits the same kind of logic once it needs to run in Excel for the web, on a schedule, or triggered by something outside Excel entirely — a new file landing in a folder, a form being submitted. Code for Excel covers choosing between VBA, Office Scripts and Python for a given task.
  • Asking an AI tool for a single formula or a one-off transformation fits anything that will not recur often enough to justify building and maintaining either of the above — most “automation” requests are actually this, dressed up.

A worked example: the monthly report refresh

Take a real recurring task: a new raw-data tab lands in a workbook every month, and someone needs to clean it, roll it into a summary, flag any region whose total dropped more than 10% against the previous month, and let the right people know.

Weak approach: ask a tool to “automate my monthly report.” That hides four different jobs inside one instruction — cleaning, calculation, a judgement rule and a notification — with no way to tell which one broke when the report looks wrong.

Better approach: separate the jobs and decide which layer handles each one.

  • Cleaning — standardising the new raw-data tab into fixed columns. A narrow, well-specified task an AI-written script genuinely handles well, provided you name the real sheet and column names rather than describing them vaguely — OpenAI’s and Anthropic’s own prompting guidance both make the same point: a concrete example beats an abstract instruction, and code generation punishes a vague one more than most tasks do.
  • Calculation — rolling cleaned rows into the summary. A plain formula or pivot refresh, not a model opinion on the numbers.
  • Flag rule — a fixed percentage comparison against last month’s total. Deterministic, stated once, never guessed per run.
  • Notification — an email or message once the summary is ready. Triggered by the flow, read by a person before anything goes to anyone outside the team.

Business process automation strategy covers scoring a whole list of tasks like this one before deciding which gets built first, rather than automating whichever feels most urgent this week.

Where it breaks

  • A hardcoded sheet or range reference breaks the moment a tab gets renamed or a column gets inserted — the automation does not error, it just reads the wrong cells.
  • AI-written code for the cleaning step can look completely correct and still silently process the wrong range — a well-documented property of how these models generate text, not a rare glitch specific to spreadsheets.
  • A scheduled flow that “worked last month” can quietly stop if the source file moves, gets renamed, or a sign-in token expires — nothing announces this unless you are checking for it.
  • The flag rule drifting out of date — a threshold copied from an old policy, or a percentage calculated against the wrong baseline month — looks identical to a correct result until someone checks the underlying numbers.

Checks before it runs unattended

  1. Name the real sheet names, tab names and column letters when you ask a tool to write the cleaning or calculation step — a vague description of the layout is where most silent failures start.
  2. Run the whole flow on a copy of the workbook first, and compare its output to a version you built by hand before trusting it on the live file.
  3. Confirm the flag threshold against the actual current policy, not a number someone remembers from when the flow was set up.
  4. Decide in advance what a silent failure would look like — a notification that stops arriving, or a flagged-region count that goes to zero — the same habit the NIST AI Risk Management Framework recommends for any automated process, scaled down to one monthly report.

What to do Monday

Pick the one Excel task you redo every week or month, and work out which of the three shapes it actually needs before building anything — most tasks turn out to need the smallest one, not the most capable. An Excel user defined function is worth reading next if the recurring part is really one formula used everywhere rather than a whole workflow, and how to add data analysis in Excel covers the built-in tools worth checking before reaching for AI or a script at all.

Knowing which layer of a task is safe to automate and which still needs a person reading the result is the same judgement behind the wage premium PwC has been tracking for workers with measurable AI skills — 62%, up from 57% the year before. Coursium teaches that judgement directly, one short lesson at a time. Stay ahead of AI by learning the tools on your phone.

Coursium

Stay ahead of AI — learn the tools on your phone.

Get the app