Privacy and Security

Is This Excel Macro Safe? How to Read VBA Code Without Opening the File

How macro malware works, how to extract and read VBA code from Office files without running it, and which warning signs in the code matter.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
Is This Excel Macro Safe? How to Read VBA Code Without Opening the File

Is This Excel Macro Safe? How to Read VBA Code Without Opening the File

Enabling macros in an unexpected document is one of the most common ways computers get infected. Yet macros are also normal business tools. The VBA Macro Viewer and Safety Scan lets you read the code first, without opening Office.

How macro attacks work

An email arrives with an invoice, CV or shipping notice. The document says content is blocked and asks you to enable editing and macros. A procedure called Workbook_Open or AutoOpen then runs automatically, often launching PowerShell to download and start a program.

What the viewer does

It unpacks the file, finds the VBA project and decompresses each module exactly as Office stores it (following Microsoft's MS-OVBA and MS-CFB specifications), then shows the source code as plain text. Nothing is executed.

Warning signs

SignWhy it matters
Workbook_Open, AutoOpen, Document_OpenRuns as soon as macros are enabled
Shell, WScript.Shell, PowerShellRuns commands on your computer
URLDownloadToFile, XMLHTTPDownloads from the internet
Long Chr() chains, StrReverse, Base64Hides what the code does
URLs, IP addresses, .exe namesWhere it connects and what it runs

One indicator alone is not proof: a legitimate macro may create objects or write files. An auto-run procedure combined with downloads or obfuscation is a strong red flag.

What to do

  • Unexpected file with high-risk indicators: do not enable macros, report it to IT, delete it.
  • Known file from a colleague: read what it does, ask about anything unclear, then decide.
  • Your own workbook: download the modules as .bas files to back up or version your code.

Protecting your organisation

Group policy can block macros in files that came from the internet, which Microsoft enabled by default in recent Office versions. Keep that protection on, train staff to report unexpected attachments, and use a viewer like this one to check files instead of enabling content.

Limits

The scan does not cover Excel 4.0 macro sheets, embedded objects, DDE or remote templates, and it is not antivirus. A clean result is not a guarantee; when in doubt, ask your IT team.

Work in small, saved steps

Every tool in this series keeps your work as a project in your own browser. Make a change, check the preview, and use undo (Ctrl+Z) or redo (Ctrl+Y) freely; nothing is lost while you experiment. Before a big change, save a named copy from the Projects menu, so you can return to it later or compare two versions side by side. Export the project file when you want to move it to another computer or keep a backup, and import it again whenever you need it.

Privacy by design

The processing happens in the page itself. Files you open are read by code running on your device, results are calculated locally, and nothing is sent to a server or stored in a cloud account. That makes the tool suitable for customer lists, financial data and other material you would not upload to an unknown website. If a component such as a file reader or a map outline is downloaded from a public CDN, only that open-source code or public data is fetched, never your own content.

Share the result clearly

When you pass the output to colleagues, say where the data came from, when it was exported, and which settings you used, so that someone else can repeat the work and get the same answer. Keep the original file unchanged and store the cleaned or calculated version separately. A short note with the assumptions, filters and date saves a lot of questions later and makes the result easier to trust.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages