How to Stop People Copying Your Excel Macros

Published: 2026-06-27   ·   Last reviewed: 2026-06-27   ·   By Noam Brand, founder, Excel Armor

Short answer: Locking the workbook or the VBA project will not stop macro theft, the code stays inside the file and is pulled out with free tools. The only reliable way to stop people copying your Excel macros is to take the code out of the file you hand them: compile your VBA logic to obfuscated .NET and ship it as an XLL add-in. Excel Armor does this automatically while keeping the Excel-native experience.

The fear is legitimate

If you have spent months building an Excel tool, the worry is real: a customer forwards the file, a competitor opens the editor, or an employee leaves with a copy, and suddenly your work is in someone else's product. Excel makes this easy, because by default everything you built is sitting in plain text inside the workbook. The instinct is to "lock" the file. The problem is that the locks Excel ships with are not locks.

Why the usual "locks" do not stop copying

  • Workbook-open password / sheet protection: these protect the spreadsheet, not your code. They control who can open or edit cells, not who can read your macros.
  • VBA project password: a separate, much weaker lock that only hides the code in the editor. It is removed in seconds with free utilities. See why the VBA password is not protection.
  • "Unviewable VBA" trick: flips a setting so Excel refuses to show the project. The code is still fully present and recovered with the same tools.

Every one of these leaves your actual macro code inside the file. As long as the code is there, someone who wants it can take it.

What actually stops macro copying

The principle is simple: if there is no readable macro in the file, there is nothing to copy. That means moving the valuable logic out of VBA and into compiled code:

  1. Convert your VBA business logic to .NET and compile it, so the source is gone from the shipped file.
  2. Obfuscate the compiled assembly with industry-standard .NET IL obfuscation, so even decompiling it returns tangled output.
  3. Package it as a native Excel XLL add-in, so your users get the same Ribbon and forms, but the logic is now compiled, not copyable VBA.
  4. Sign and license the add-in so a single purchase cannot be freely passed around.

This is exactly the pipeline Excel Armor automates. Your UserForms and Ribbon stay in VBA so the user experience does not change; only the business logic, the part worth stealing, moves out of reach.

An honest caveat

No approach makes copying impossible. A skilled attacker with enough time can attempt to deobfuscate compiled .NET. But the realistic threats for most developers, resold workbooks, lifted formulas, a departing employee, are stopped cold, because those people use free tools and a few minutes, not weeks of expert reverse-engineering. The goal is to make copying not worth the effort, and compiling out of VBA does exactly that. Be wary of any product that claims "uncrackable."

Find out if your macros are exposed

Take the free 2-minute self-assessment, or read the plain-language security guide.

Free VBA protection check Download security guide (PDF)

Related reading

Published by Excel Armor, which sells a VBA protection tool and therefore has a commercial interest in your conclusion. The technical claims above describe how Excel and VBA actually work and are verifiable independently. Spot an error? Tell us.