Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › cybersecurity

How to Remove Macros and Inspect VBA Code in an Excel Workbook Safely

By Freedom251 Team · · 12 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep macros disabled, inspect the workbook’s VBA in Excel’s Visual Basic Editor, and work on a duplicate. You do not need to enable macros merely to view or edit the file. If your goal is to remove VBA, save the duplicate as a standard .xlsx workbook, then reopen it and verify the result. Keep the original .xlsm or .xlsb file until you know no macro-dependent feature is needed.

Choose the operation that matches your goal

“Remove macros” and “inspect a workbook” are separate jobs. Reading code in the Visual Basic Editor leaves the workbook’s VBA in place. Saving a copy as .xlsx removes VBA from that copy because the standard format does not save macros. Document Inspector performs selective cleanup of document information and some active-content-related items; it is not a substitute for either code review or conversion to a macro-free format.

As an Amazon Associate I earn from qualifying purchases.

Goal Method Effect on the working copy How to preserve recovery options
Read or edit VBA without running it Developer > Visual Basic, with macros disabled Code remains in the original file Open a duplicate and retain the untouched original
Remove VBA from a copy Save As a standard Excel Workbook (.xlsx) VBA is not saved in the new file; macro-enabled behavior may stop working Keep the original .xlsm or .xlsb
Inspect or selectively remove document findings File > Info > Check for Issues > Inspect Document Removes only the categories you select; some actions cannot be undone Run it on a copy and review each finding before choosing Remove All

Choose the method by asking three questions: Do you need to read code, deliver a file with no VBA, or clean selected document information? Is the change reversible if a calculation, button, or event stops working? Which workbook functions must remain available? A conversion to .xlsx is appropriate for a macro-free deliverable, but not for the authoritative file when automation is still part of the process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare a safe working copy

Preserve the source file

Make an untouched copy before opening removal tools or changing the format. Give the duplicate a new name such as Workbook-inspection-copy.xlsm and store the original somewhere you will not overwrite accidentally. This matters when the workbook contains business logic, event procedures, hidden sheets, or links that are difficult to reconstruct.

Microsoft recommends using Document Inspector on a copy because some removals cannot be restored with Undo. The same copy-first principle is sensible for format conversion: once VBA is omitted from an .xlsx, restoring it requires returning to the original or another backup.

Record provenance before you start

Note where the file came from, who supplied it, its original filename, and the date you received it. Keep the source and duplicate clearly separated, and avoid saving the duplicate over a shared production location. If the workbook is being reviewed by a security team, provide the original and any available hash or provenance record rather than modifying the only copy.

Do not enable content to read code

When Excel displays a security warning, leave macros disabled. Microsoft’s support guidance is explicit: “You don’t need to enable macros to view or edit the file.” Do not change global macro settings, add the folder as a trusted location, or unblock an internet-downloaded file just to inspect its modules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Macro settings apply per Office application, and an employer or school policy may prevent you from changing them. A disabled-macro banner is therefore not a problem to work around during a basic review; it is the safer starting state. A trusted location is a security decision, not a convenient viewing mode.

Open the Visual Basic Editor without running the workbook

Show the Developer tab

In desktop Excel, the built-in route to VBA is the Developer tab. If it is hidden, use Excel’s ribbon customization options to display Developer. The exact label and location can differ by Excel release and platform, so use the application’s current ribbon settings rather than changing security controls.

Open the editor

  1. Open the duplicate workbook in Excel desktop and keep any macro or content warning disabled.
  2. Select Developer > Visual Basic.
  3. In the Visual Basic Editor, show the project tree with View > Project Explorer. On Windows, Microsoft also documents Ctrl+R for Project Explorer.
  4. Expand the workbook’s VBA project and select each available object, including standard modules, class modules, UserForms, ThisWorkbook, and individual worksheet objects.

Opening the editor and selecting a module displays its source as text. Do not press Run, use step-through execution, or invoke a procedure while you are deciding whether the workbook is trustworthy. If the editor is unavailable in your edition or blocked by policy, stop and use an approved review process instead of weakening Office security settings.

What to inspect in the VBA project

Standard and class modules

Read the procedures in each standard module from top to bottom. Note the names of public procedures, their stated purpose, and any procedures that appear to be entry points for buttons or shortcuts. Class modules can contain event handlers or reusable logic that is called from elsewhere, so do not assume an apparently empty standard module is the whole project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the editor’s search and navigation tools to follow calls between procedures. Record which module contains each important routine and whether the routine appears to change worksheets, refresh data, create files, or communicate with another component. This inventory helps you compare the macro-enabled source with the later .xlsx copy without executing anything.

Workbook and worksheet events

Inspect ThisWorkbook and every worksheet object. Event procedures can run when a workbook opens, closes, is activated, or when a cell changes. Their presence does not, by itself, establish that the file is harmful; it does explain why a workbook can perform actions without a user selecting a visible macro.

Check hidden worksheets and workbook structure as well as visible tabs. Hidden rows or sheets can affect calculations, and a cleanup action that removes or alters them may change results. Do not treat an empty-looking visible sheet as evidence that the project has no meaningful logic.

References and dependencies

Review the project’s references and any components shown by the editor. Code may depend on libraries, installed add-ins, or other components and may call external resources. A text review cannot certify that a project is harmless, and a missing reference can make legitimate automation fail after migration to another computer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Separate a missing dependency from a suspicious one. Either can cause errors, but neither should be “fixed” by enabling all content during an initial inspection. Ask the workbook owner or your security team to identify unknown components before allowing them.

Read without executing

Use the editor’s navigation and search features to follow calls between procedures, but keep execution disabled. Avoid opening embedded forms merely to test their controls. If you need a deeper security assessment, provide the original and a hash or provenance record to your organization’s security team rather than experimenting by enabling content.

Remove VBA from a duplicate by saving as .xlsx

Use Save As, not Save

  1. Close the Visual Basic Editor without running any procedure.
  2. In Excel, choose File > Save As and select a separate filename for the duplicate.
  3. Set the file type to Excel Workbook (*.xlsx), the standard macro-free format.
  4. Accept Excel’s warning that the selected format cannot preserve VBA or other macro functionality.
  5. Close the newly saved file, then reopen it independently from the original.

The .xlsm and .xlsb formats are macro-enabled. A standard .xlsx does not save VBA macros. Consequently, procedures, event code, and user-interface features that depend on those procedures will not be available in the converted copy.

Do not rename an extension by hand and assume that it changes the file format. Use Excel’s Save As file-type selection so the workbook is actually written in the standard format and Excel can display its feature-loss warning.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the converted file

  • Confirm the filename ends in .xlsx and that you opened the new copy, not the source.
  • Open Developer > Visual Basic and check whether the workbook project still contains modules. VBA should not be present in a correctly converted standard workbook.
  • Test ordinary worksheet calculations, formatting, charts, and data that should remain static.
  • Check for expected warnings or broken controls. A button that previously launched a macro may remain visually present while no longer performing its action.
  • Compare important totals or outputs with the original while macros remain disabled; document any difference rather than silently correcting it.
  • Keep the original macro-enabled file until the business owner confirms that no automation, event behavior, or custom form is required.

Verification is about function, not just the extension. A successful conversion can still leave a visually intact worksheet whose refresh button, custom form, or event-driven update no longer works. Label the converted copy as macro-free so users do not mistake it for the automation-capable source.

Use Document Inspector for selective cleanup

Document Inspector addresses a different risk: it reports categories of document information and active-content-related material that Excel can identify. It should not be described as a complete malware scanner, and a clean report does not prove that every external connection or active component is gone.

Run the inspection on a copy

  1. Open the duplicate workbook.
  2. Select File > Info > Check for Issues > Inspect Document.
  3. Choose the categories relevant to your purpose and start the inspection.
  4. Read the findings and decide what, if anything, should be removed.
  5. Choose Remove All only for a category whose effect you understand.
  6. Save the inspected copy under a new name, close it, and reopen it to check calculations and layout.

Document Inspector is useful when the goal is to identify selected document metadata or content categories, not when the goal is simply to read VBA. It also should not be presented as a substitute for an organization’s malware analysis process.

Understand the limits of automatic removal

Some VBA-related content may be detected but cannot be removed automatically because the workbook could stop working properly. Hidden rows and hidden sheets can also affect calculations, so inspect the workbook’s visible and hidden structure before treating a cleanup report as proof that the file is safe or complete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Document Inspector’s selective removals may not be reversible with Undo. If a finding is important to the workbook’s operation, preserve the source and record what you changed before removing it. Reopen the result and check both presentation and calculations after every material cleanup.

Removing VBA is not removing every active element

Excel 4.0 macros (XLM)

Excel distinguishes legacy Excel 4.0, or XLM, macros from VBA macros. Converting a workbook to .xlsx prevents VBA from being saved, but you should not expand that fact into a claim that every macro technology has been identified or that all active content is absent. Review the XLM macro setting and any findings Excel presents separately.

ActiveX controls, add-ins, and external content

Workbooks can include ActiveX controls, installed add-ins, linked data, queries, or other external content. A worksheet button, control, or connection may remain even when VBA is removed, and it may simply stop functioning. Treat those components as separate inventory items and follow your organization’s policy for disabling or removing them.

External connections and trust decisions

A file can contain links or connections that do not require VBA. Do not add the workbook to a trusted location merely to make those features work during inspection. First establish who supplied the file, why the connection exists, and whether the destination is approved.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Internet-origin warnings and platform differences

On specified Office versions running Windows, Microsoft documents that macros originating from the internet can be blocked by default under conditions involving file origin and other controls. The behavior depends on factors such as Mark of the Web, trusted locations, signatures, and organizational policy. The documented change does not apply in the same way to Office for Mac, Android, iOS, or the web.

An internet-file warning is a reason to verify provenance, not an invitation to unblock the file. If you need to inspect the code, use the disabled state and the Visual Basic Editor. If policy prevents access to the editor, ask an administrator or security team for an approved review process rather than weakening the policy yourself.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure modes and the safe response

“The Developer tab is missing.”

Enable the Developer tab through ribbon customization in desktop Excel. If your organization controls the ribbon or macro policy, contact the administrator. Do not compensate by enabling all macros or using a trusted location.

“The Visual Basic Editor opens, but I cannot find the project.”

Turn on View > Project Explorer (or Ctrl+R on Windows), then expand the workbook node. If no project is present, you may be viewing an .xlsx copy or a workbook whose VBA project is protected. A protected project is not evidence that the file is safe; preserve the original and follow an authorized review path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Excel says the format cannot preserve features.”

That warning is expected when saving a macro-enabled workbook as .xlsx. Accept it only for the duplicate whose purpose is macro removal. Cancel if you are saving the authoritative working file and still need its VBA.

“The converted workbook looks different.”

Compare the new copy with the original. Macro-driven buttons, event actions, custom forms, and automated refreshes can stop working even though cells and formatting remain. Restore the original for users who require those features, and use the .xlsx copy only where a macro-free workbook is acceptable.

“Document Inspector reports an item it cannot remove.”

Leave the original untouched, read the explanation, and decide whether the item is essential to workbook operation. Microsoft notes that some VBA-related content cannot be automatically removed because doing so could break the workbook. Escalate to the workbook owner or security team when the finding matters.

A repeatable checklist

  • Save an untouched original and create a clearly named duplicate.
  • Record the source, filename, and date received when provenance matters.
  • Open the duplicate with macros and other active content disabled.
  • Use Developer > Visual Basic to inspect modules, workbook events, worksheet events, and references as text.
  • Do not run, step through, or enable procedures during the basic review.
  • For a macro-free deliverable, use Save As > Excel Workbook (*.xlsx) on the duplicate.
  • Reopen the converted file and verify the project, calculations, layout, controls, and expected limitations.
  • Use File > Info > Check for Issues > Inspect Document only for selective document cleanup, and review each finding before removal.
  • Consider XLM macros, ActiveX, add-ins, links, queries, and other external content separately from VBA.
  • Keep the original until the workbook owner confirms that macro functionality is no longer needed.

When to stop and seek help

Stop the self-service process if the workbook is business-critical, the VBA project is protected, the file’s origin is unclear, or the code appears to depend on unknown external components. Preserve the original, record the filename and source, and use your organization’s approved security or Excel-support process. Inspection without execution is a useful first step, but it is not a certification that a workbook is benign.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I view VBA without enabling macros?

Yes. Microsoft says you do not need to enable macros to view or edit the file. Open the Visual Basic Editor with the workbook’s macros disabled and read the project as text.

Does saving as .xlsx remove all macros?

Saving a duplicate as standard .xlsx does not save VBA. It does not prove that XLM macros, ActiveX controls, add-ins, links, queries, or other external content are absent, so review those separately.

Should I use Document Inspector instead of Save As?

Use them for different purposes. Save As to .xlsx creates a macro-free copy; Document Inspector selectively reports and removes document categories. Inspector actions can be difficult to undo, so run them on a copy.

Why did a button remain after I removed the macros?

The visual control may remain even though the VBA procedure behind it was not saved. Test the converted copy and tell users that the button no longer performs its former macro-driven action.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What if the VBA project is protected or the file came from the internet?

Do not try to bypass protection or unblock the file just to inspect it. Preserve the original, verify provenance, and ask an administrator or security team for an authorized review process.

Will the workbook still calculate after macro removal?

Ordinary worksheet calculations and formatting may remain, but event-driven updates, automated refreshes, custom forms, and other macro-dependent behavior can stop. Reopen the .xlsx copy and test expected outputs before distributing it.

The Bottom Line

Inspect VBA with macros disabled in Excel’s Visual Basic Editor. Remove VBA only from a duplicate by saving it as .xlsx, verify the result, and keep the original. Use Document Inspector for selective cleanup—not as proof that every macro, control, connection, or other active element has been removed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cybersecurityExcelMacrosMicrosoft OfficeVBA

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.