
Set-Location "HKCU:\Software\Microsoft\Office\16.0\Excel\Security\Trusted Documents\TrustRecords" #PowerShell script to clear the Excel Trusted Documents cache The script does not require administrative privileges to run. Here is a PowerShell script to delete all the Trusted Document subkeys. HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Security\Trusted Documents\TrustRecords Previously Trusted Documents are stored in the registry at the following location. PowerShell Script to clear Excel’s Trusted Documents list Click OK to save the changes and close the Trust Center settings dialog.Click the radio button next to Disable all macros without notification.Disable Macros and the Enable Macros warning ribbon Next, we will look at how to disable macros altogether. It’s important to note that this checkbox does not disable macro or the Enable Macros warning. If you want to disable Excel from tracking and marking files as Trusted you can do so by clicking the Disable Trusted Documents checkbox. The next time you open one of those files the Enable Macros warning ribbon will be presented. Choose Trusted Documents, click the Clear button and answer Yes to the confirmation dialog.Ĭlearing all trusted documents will make Excel forget any previous documents for which macros were enabled.In the Excel Options dialog choose Trust Center then click the Trust Center Settings button.Press Ctrl+O to get to the File | Open screen and choose Options from the left menu.Excel keeps track of documents that you have intentionally enabled macros on in the Trusted Documents list. If you choose the enable macros the file will be marked as a trusted document and each subsequent time you open the file macros are enabled automatically. The first time you open an excel workbook that has macros you are prompted with warning ribbon to enable macros.

Write a script to programmatically clear the trusted documents list.Disable Macros and Macro Warning Prompts.
