Replace Excel VBA macros without losing the buying rules

The Monday reorder button has stopped working and the buyer is rebuilding supplier orders by hand. To replace Excel VBA macros, document the inputs and buying rules, choose a maintained home for the work and compare its drafts with saved outputs. Name an owner and keep supplier orders subject to the buyer's approval.

The Monday button that stopped working

Picture a food distributor whose buyer presses the usual Monday button and nothing happens. It normally reads last week's sales export, works out reorder quantities and builds purchase orders for six suppliers. To replace Excel VBA macros safely, start by capturing that whole buying job.

A macro is a small program saved inside a workbook. VBA, short for Visual Basic for Applications, is the language these Excel macros use. The finance controller who wrote this one left in 2021. After an Office update, the buyer is rebuilding orders by hand while suppliers wait.

When the macro worked
  • Sales export read in a click
  • Reorder quantities calculated
  • Six purchase orders built
Since the update
  • Buyer rebuilds orders by hand
  • Nobody understands the code
  • Late orders need supplier calls

The update is a useful clue, but it doesn't establish the cause. Keep the workbook, the sales export and the last successful orders together. Whoever investigates needs to see the exact files the buyer used, including any warning shown when the workbook opens.

Write down what the macro does

For the Monday reorder, sit with the buyer and trace a product from the sales export to its supplier order. Write down what the program reads, what it changes and what the buyer checks. That gives whoever repairs or replaces it a description of the job they must preserve.

Pay particular attention to supplier minimum orders. A quantity that looks right against sales alone still needs checking against the buying rule. Ask the buyer where they make manual adjustments and why. Keep those explanations with the workbook so the replacement includes the work happening outside the button.

You'll also want examples of an ordinary order and an awkward one. Saved exports, finished purchase orders and the buyer's corrections give you something concrete to test. If nobody knows why a rule exists, mark it as unresolved and ask the person responsible for buying to decide.

Reduce dependence on the person who knows the system

Why old macros are a risk

The distributor's immediate problem is that nobody owns the knowledge behind Monday ordering. That makes even a small fault hard to diagnose. Security adds another reason to handle the workbook carefully: a macro runs code, so enabling an unfamiliar file lets that code run on your computer.

Keep security settings in place and ask your IT provider to inspect the file's origin, any warning and the error details. A blocked download and a broken buying rule need different fixes. Saving the evidence helps them investigate without asking the buyer to keep trying changes on the live ordering workbook.

Check the wider risks in business spreadsheets

Choose a safer home for the work

The Monday orders have three possible homes: a maintained script, an automation in the system holding the sales data, or an AI drafting job with buyer approval. Choose around the work your buyer actually does and who will maintain it after the first successful run.

Choose this when

  • Maintained script for clear rules with a named owner
  • Existing system automation when the sales data already lives there
  • AI drafts when a buyer checks each order

Avoid these shortcuts

  • Copying the unexplained macro into another workbook
  • Switching macro security off
  • Replacing the button without naming an owner

A script suits repeatable calculations with clear inputs. Existing system automation suits an ordering process already recorded there. AI drafting suits work that includes reading notes and preparing an order for review. For this distributor, supplier minimums still need explicit rules whichever route you choose.

Office Scripts is a Microsoft option to assess if the buyer's work stays in Excel. Ask whoever maintains your systems to check whether it covers this particular macro. You still need a written buying process and someone responsible when the sales export changes. If you're weighing AI for the Monday orders, here's when it fits.

A good fit if

  • AI drafts have clear source records
  • The buyer can check quantities and supplier rules
  • Unclear items can wait for a decision

Probably not yet if

  • Supplier minimums are still unexplained
  • Nobody can review the draft orders
  • Orders must be sent without checking

If the whole workbook has become hard to maintain, review where the buying records belong before choosing how to automate them.

Decide when the whole workbook needs replacing

Run old and new side by side

The buyer's saved orders let you test the replacement even while the old macro is broken. Use last month's sales exports and compare the new drafts with the purchase orders the buyer accepted. If the old macro is restored safely, run both on the same records without sending duplicate orders.

A difference on minimum order needs an explanation before switching. The head buyer checks the rule, the export and any manual correction to the old order. Record the decision and repeat the comparison after the fix. Agreement with an old output is useful evidence, but the buyer must also confirm that output was right.

Agree who maintains the replacement after launch

For an AI route, we help document the job, connect AI to the records it needs and set it up to prepare orders for approval. We train the buyers on the new set-up first, then keep it in step with your business. Bring the broken reorder workbook to a sense-check call with Struan, together with a saved order your buyer trusts.

Questions and answers

What can replace Excel VBA macros?

Three routes work: a maintained script, automation in your existing system, or AI preparing drafts for approval. Start with the macro's inputs, rules and outputs. A fixed calculation needs a different replacement from work that involves interpreting supplier notes. Give whichever route you choose a named owner and written instructions.

Why have my Excel macros stopped working?

The usual suspects are a security setting, a changed input file or a fault in the code. An update just before the failure is a clue worth following. Keep the exact workbook, input file and warning for your IT provider. Leave macro security enabled while they establish what stopped the job.

Can AI rewrite or replace a VBA macro?

AI can help explain code or prepare a replacement, but generated code still needs review and testing by someone able to maintain it. For the buying job, compare quantities, supplier minimums and complete orders with known examples. The head buyer should approve the result before any order reaches a supplier.

Sources

The Monday button that stopped working

Ready to put the advice to work? Tell us where your week gets stuck. We’ll show you how we’d set AI up to help and keep it in step with your business.

See how we set AI up around your work