Sep 26 2021 05:55 AM
By default, excel adds personal information to the workbook, which I know how to remove after I've created and saved the workbook via:
"File -> Info -> Check for Issues -> Inspect Document -> Inspect" and then remove "Document Properties and Personal Information".
However, this is really annoying to need to remember and do for every workbook I create.
How can I change this to be the default such that "Document Properties and Personal Information" (especially author) won't be saved when I create a new workbook?
Sep 26 2021 10:19 AM
Remove hidden data and personal information by inspecting documents, presentations, or workbooks
Note: Although you can remove hidden data and personal information from workbooks you have sent to other people, if the Excel workbook has been saved as a Shared Workbook, you can't remove comments, annotations, document properties, and personal information. To remove this information from a shared workbook, first copy and turn off the Shared Workbook feature.
Disable Document Information Panel
If you enable this policy setting, forms and controls will not appear in the document information area. The actual area appears when users open it, but it is empty. If you disable or do not configure this policy setting, users can view the document information pane.
Registry Hive | HKEY_CURRENT_USER |
Registry Path | software\policies\microsoft\office\16.0\common\documentinformationpanel |
Value Name | disable |
Value Type | REG_DWORD |
Enabled Value | 1 |
Disabled Value | 0 |
Option Explicit
Sub RemovePersonalInfos()
'Switch off warnings
Application.DisplayAlerts = False
With ActiveWorkbook
'Option aktivieren
.RemovePersonalInformation = True
'Personal information is deleted when the data is saved
.Save
'Option deaktivieren
.RemovePersonalInformation = False
'Save the file again
.Save
End With
'Switch on warning notices
Application.DisplayAlerts = True
End Sub
Hope I was able to help you with this info.
NikolinoDE
Was the answer useful? Mark them as helpful!
This will help all forum participants.
Sep 27 2021 09:27 AM - edited Sep 27 2021 09:28 AM
@NikolinoDE The macro option (the third option in your reply) is the closest that I've seen yet. I guess that if I would manage to make it run whenever a new workbook is created it would be almost what I wanted. By the way the registry option (the second option in your reply) don't seem to have any effect in my machine. Thanks you for the help.
Sep 27 2021 03:25 PM
I've ended up using the VB from above to make it execute whenever a new workbook is created and remove personal information. These are the steps in case anyone else needs it:
1) Create a "personal.xlsm" file and put it in "C:\Users\<USER>\AppData\Roaming\Microsoft\Excel\XLSTART\"
2) In the Macro Dialog in the "personal.xlsm" file then:
a) Add a new class called "AppEvents"
b) In the "AppEvents" dialog enter the following code:
Private WithEvents App1 As Application
Private Sub Class_Initialize()
Set App1 = Application
End Sub
Private Sub App1_NewWorkbook(ByVal Wb As Workbook)
RemovePersonalInformation
End Sub
Private Sub RemovePersonalInformation()
Application.DisplayAlerts = False
With ActiveWorkbook
.RemovePersonalInformation = True
.Save
End With
Application.DisplayAlerts = True
End Sub
c) In the "ThisWorkbook" dialog enter the following code:
Private AppEvents1 As AppEvents
Private Sub Workbook_Open()
Set AppEvents1 = New AppEvents
End Sub