Macros or VBA code found

Applies To
Excel for Microsoft 365 Word for Microsoft 365 PowerPoint for Microsoft 365 Excel 2024 Word 2024 PowerPoint 2024 Excel 2021 Word 2021 PowerPoint 2021

The Document Inspector found one or more of the following items that may contain hidden data in your Office document (Word, Excel, or PowerPoint):

  • Macros (including any WordBasic macros in Word documents or Excel 4.0 Macro Sheets (XLM) in Excel workbooks)
  • VBA modules
  • COM or ActiveX controls
  • User Forms (including any Excel 5.0 Forms in Excel workbooks)
  • User-Defined Functions (UDFs) in Excel workbooks

Issue

The Document Inspector can't remove these items for you, because removing these items may cause your document to stop working properly.

  1. Close the Document Inspector.

  2. Manually remove any macros, VBA modules, COM or ActiveX controls, user forms, or UDFs that might have hidden data from your document.
    Here's how you can find macros and VBA modules in your document:

    • In Word or Excel, select View > Macro > View Macros.
      In PowerPoint, select View > Macro.
      In the Macro box, pick the macro you want to remove and select Delete.
    • Press Alt+F11 to find macros in the VBA Editor.
  3. To verify the issue is resolved, select File > Info > Check for Issues, and then select Inspect Document. Check or uncheck boxes next to items you'd like to check for. 

  4. Select Inspect to view your report.