TransWikia.com

How to remove Document Inspector warning in Excel

Super User Asked by Tess in Oz on January 14, 2021

I’m running VBA scripts on a series of files that are XLSM type. While I’m trying to automate my processes, I’m getting stopped by this warning about the Document Inspector, meaning I have to click OK for every file.

Is there a script I can run on my files in advance, or embed one in my code, that will remove this warning?


Warning Message

Document Inspector error

Be careful! Parts of your document may include personal information
that can’t be removed by the Document Inspector.

3 Answers

open the document > alt+f11 > Module Thisworbook input this:

Private Sub Workbook_AfterSave(ByVal Success As Boolean)
    Application.DisplayAlerts = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Application.DisplayAlerts = False
End Sub

Answered by Francisco Costa on January 14, 2021

My Solution

Instead of disabling the Document Inspector which seems difficult to do in VB, I'm just blocking the message itself. I don't really care about the source file, I just want to seamlessly copy data out of them so this will work in my case just fine.

By adding this code to the start of my code, I no longer get the Document Inspector warning:

'Disable privacy settings warning
Application.DisplayAlerts = False

Answered by Tess in Oz on January 14, 2021

Potential solutions to the "Be careful! Parts of your document may include personal information that can't be removed by the Document Inspector." warning message.

To remove Document Inspector warning in Excel 2016 or Excel 2013 you can check two things

  • Go to File in the upper left hand corner,
  • then Options > Trust Center > Trust Center Settings > Privacy Options
  • then un-check the check box that says "Remove personal information from file properties on save",
  • then hit OK.

Source

Or

  • Go to File > Info
  • and click in "Allow this information to be saved in your file".

The next time you save there should be no more warning.

Source

Answered by Drink Some Pimp Juice IT on January 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP