Trust access to the vba project object model

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,516
Hi

I am reading about macro settings and found this link about the option

[] trust access to the vba project

Mine is not check and I ran many small macros without problem so far. I read what is explained below but did not understand it well. Could you please explain to me why I need this option. Thank you very much.

https://bettersolutions.com/vba/macros/macro-settings.htm




Trust access to the VBA project object model (Default is off) This setting is for developers and is used to allow programmatic access to the VBA object model from any Automation client. For any Automation client to be able to access the VBA object model programmatically, the user running the code must explicitly grant access. This option was available in 2003 and has not changed.
All macros in trusted locations are allowed to run regardless of your macro security setting.
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
11,281
Office Version
2013
Platform
Windows
Checking the box will give the user access to the Developer tools of VBA which allows macros to be written, help files to be accessed, etc. You might have been able to run macros without the block checked but you did not have full access to the Developer tools.
 

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,516
Thank you very much. I checked that box. I went to vba. I did not see any change in the menu, or anywhere else. So not sure what that box added to my environment? Thank you again
 

Kyle123

Well-known Member
Joined
Jan 24, 2012
Messages
2,684
You don't get extra options by checking that box and it's off by default for a reason.

You only need to to enable it if you are writing code to change code in the IDE, which for 99% of things is a bad idea
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,270
Office Version
365
Platform
Windows
I would recommend leaving it unchecked, otherwise you are increasing the chance of getting bitten by something nasty.
For instance, I could write a macro that would delete all the code in your Personal.xlsb & then save it, now if you leave the "Trust access to the VBA project object model" unchecked then the code would not work, otherwise it will.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,349
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
It basically just allows your code to access the VBProject object and its properties/methods. It doesn't really have anything to do with the Developer tab or any additional menus in the VB Editor.
 

Forum statistics

Threads
1,082,126
Messages
5,363,315
Members
400,725
Latest member
excelingtolearn

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top