If you want to enable or disable Trust access to Visual Basic Project in Office apps, such as Word, Excel, PowerPoint, etc., you can do so with the help of the in-built option, Local Group Policy Editor, and Registry Editor.
What is Trust access to the VBA project model?
VBA Project Model helps users run various codes from any automation client. At times, you might need to do something in the Excel spreadsheet, and the corresponding option is not present. In such situations, you can use Visual Basic to get things done manually. Many times, such codes may not work correctly until or unless you turn on the Trust access to Visual Basic Project setting.
Note: In every instance, we have used Microsoft Excel for demonstrations. However, you can use Word or PowerPoint as well.
Enable or disable Trust access to Visual Basic Project in Office apps
To enable or disable Trust access to Visual Basic Project in Office apps, follow these steps:
- Open Microsoft Excel and click on Options.
- Switch to the Trust Center tab.
- Click the Trust Center Settings button.
- Go to the Macro Settings tab.
- Tick the Trust access to the VBA project object model checkbox.
- Click the OK button.
To know more about these steps, continue reading.
First, you need to open Microsoft Excel or Word or PowerPoint and click the Options visible in the bottom left corner. Then, switch to the Trust Center tab and click on the Trust Center Settings button.
Next, switch to the Macro Settings tab and tick the Trust access to the VBA project object model checkbox.
Click the OK button to save the change.
Enable or disable Trust access to Visual Basic Project using Group Policy
To enable or disable Trust access to Visual Basic Project using Group Policy, follow these steps:
- Press Win+R to open the Run prompt.
- Type gpedit.msc and click the OK button.
- Navigate to Trust Center in User Configuration.
- Double-click on the Trust access to Visual Basic Project setting.
- Choose the Enabled option.
- Click the OK button.
Let’s check out these steps in detail.
To get started, press Win+R to display the Run prompt, type gpedit.msc, and click the OK button to open the Local Group Policy Editor. Then, navigate to the following path:
Excel:
User Configuration > Administrative Templates > Microsoft Excel 2016 > Excel Options > Security > Trust Center
Word:
User Configuration > Administrative Templates > Microsoft Word 2016 > Word Options > Security > Trust Center
PowerPoint:
User Configuration > Administrative Templates > Microsoft PowerPoint 2016 > PowerPoint Options > Security > Trust Center
Double-click on the Trust access to Visual Basic Project setting and choose the Enabled option.
Alternatively, choose the Disabled option to turn it off.
Click the OK button to save the change.
Turn on or off Trust access to Visual Basic Project using Registry
To turn on or off Trust access to Visual Basic Project using Registry, follow these steps:
- Press Win+R > type regedit > hit the Enter button.
- Click the Yes option.
- Navigate to Microsoft\office\16.0 in HKCU.
- Right-click on 16.0 > New > Key and name it as excel.
- Right-click on excel > New > Key and name it as security.
- Right-click on security > New > DWORD (32-bit) Value.
- Set the name as accessvbom.
- Double-click on it to set the Value data as 1.
- Click the OK button and restart your PC.
To learn more about these steps, continue reading.
For getting started, press Win+R > type regedit and hit the Enter button. If the UAC prompt appears on your screen, click the Yes button.
Then, navigate to the following path:
HKEY_CURRENT_USER\Software\Policies\Microsoft\office\16.0
Right-click on 16.0 > New > Key and name it as excel/word/powerpoint.
Repeat the same steps to create a sub-key named security. Then, right-click on security > New > DWORD (32-bit) Value and set the name as accessvbom.
Double-click on it to set the value data as 1.
Click the OK button and restart your PC. However, if you want to turn this feature off, you have two options. First, you can set the value data as 0 and restart your computer. Second, you can delete the REG_DWORD value and restart your computer.
How do I enable Trust access to the VBA project object model?
There are three different ways to enable Trust access to the VBA project object model, and all the methods are mentioned above. If you do not want to go through several options, you can use the in-built settings panel. On the other hand, you can use the Local Group Policy Editor and the Registry Editor to get it activated.
Read: How to enable or disable Live Preview in Word, Excel, PowerPoint
How do I enable a project in VBA?
To enable Trust access to Visual Basic Project in Excel, Word, or PowerPoint, you need to use the Trust Center Settings. Apart from that, you can use the GPEDIT and REGEDIT methods. In the Group Policy, open the Trust access to Visual Basic Project setting and choose the Enabled option.
Read: How to turn on or off File validation in Word, Excel, PowerPoint.