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: 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: 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: Word: PowerPoint: 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: 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: 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.