Last verified: November 2026

Keyboard Macros vs Excel VBA Macros at Work

Two things share one name. Here is how they differ and which rule applies to each. Part of our guide to keyboard macros at work.

  • What each kind of macro is
  • How Office blocks internet macros
  • Which approval rule applies
Keyboard macro versus Office macroKeyboard macroSends keystrokesWorks in any windowNeeds a tool on the PCOffice macroRuns VBA codeLives inside a fileBlocked from the internetNot the sameTwo kinds of macroCheck the file first

Two Different Things Called Macros

A keyboard macro is a saved trigger that types text or presses keys, while an Excel or Word macro is VBA code stored inside an Office file. They are separate, and Microsoft blocks the second kind from the internet by default.

The word “macro” covers both, which is why a safety rule about one gets applied to the other. Your employer’s rule on Office macros says nothing about a text expander, and the reverse is also true. Each needs its own approval question.

Keyboard macros and Office macros side by side
PointKeyboard macroExcel or Word macro
What it isA trigger that sends text or keysVBA code inside a document
Where it livesA macro tool’s own fileThe Office file itself
How it spreadsYou install a toolA file arrives by email or download
Main riskAn unapproved tool; secrets stored in textMalicious code run when a file is opened
Default blockNone; IT policy decidesBlocked from the internet by Microsoft’s default
Keyboard macro and Office macro comparedKeyboard macroTrigger → keystrokesAny app with focusInstalled on the PCYour IT team approves the toolOffice macroVBA code in a fileRuns inside OfficeTravels with the fileYour IT team approves the file
Two kinds of macro with different homes and different risks.

How Office Blocks Internet Macros

Office blocks macros in files from the internet through the Mark of the Web, a flag Windows attaches to downloaded files. Microsoft rolled the default block out from April 2022 and extended it to Publisher in 2023 and Project in 2024.

When you open a flagged file, a red “security risk” banner appears. The Unblock checkbox in the file’s Properties removes the flag, and a Group Policy named “Block macros from running in Office files from the Internet” can enforce the block. The behavior applies to Office on Windows.

Mark of the Web flow1Downloadfrom the web2Mark addedZone.Identifier3Open in Officebanner shown4Macros blockeduntil unblockedMicrosoft blocks macros in files from the internetby default in Office on Windows
A downloaded file carries a flag that tells Office to hold the macros back.

The UK’s NCSC and Australia’s ACSC both advise turning Office macros off unless there is a business need. That advice targets VBA. It is not guidance about typing tools.

Which Rule Applies to You

If a file asks you to “enable macros”, the Office rule applies and you should stop and ask. If a tool types text for you after a hotkey, the software-approval rule applies. Know which one you are looking at.

  • Never enable macros in an unexpected attachment. This is the classic route for malware in Office files.
  • Ask before installing any typing tool. The approval guide shows how.
  • Keep the two separate in your request. Tell IT you mean a keystroke tool, not VBA.
Tip

A text macro tool such as Macro Keys types text into an open Excel cell. That is not an Excel macro, but it does fall under software approval.

For the overall safety answer and the three-question test, return to the main guide.

Why You Should Not Automate the Enable Button

A keyboard macro could press the Enable Content button for you, but that click is the one control Office gives you to stop and think. Automating it removes the only check between a file and its code.

Microsoft’s warning banner appears because the file carries the Mark of the Web, and the button is how a person says “I know where this came from.” A macro that clicks it every time says that for every file, including ones you never read. Security teams treat that as a reason to block the tool outright.

  • Fine to automate: typing a standard note into a cell, or moving between fields with Tab.
  • Not fine to automate: Enable Content, Unblock, or any prompt that asks whether to trust a file.
  • Ask first: any macro that opens, saves or sends workbooks on its own.

If the workbook holds customer or payroll data, keep it in a protected location. The Folder Lock product page describes password protection for folders on Windows, which is a separate job from controlling macros.

Common mistake

Treating “macros are blocked” as a fault to fix. The block is Office doing its job, and the person who owns the file’s security should decide whether to lift it.

Questions About Vs Excel macros

No. VBA is code stored in an Office file. A keyboard macro tool types text or presses keys from a hotkey, outside Office.

The file came from the internet and carries the Mark of the Web flag, so Office blocks its macros by default.

Only if you trust the source and your IT policy allows it. If unsure, ask IT first.

A keyboard macro can press keys that open the editor, but doing so is a scripting task for IT review, not a text macro.

It could, but it should not. That click is the check Office uses to make you look at the file first, and automating it defeats the warning.

No. The block applies to VBA macros in Office files, not to separate typing tools.