[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1511
  • Last Modified:

VBA code to add trusted location in Microsoft Access 2010

Does someone have VBA code that will add a trusted location in Microsoft Access 2010?
0
twarrenb
Asked:
twarrenb
  • 3
  • 3
1 Solution
 
Shahid ThaikaSole ProprietorCommented:
Unfortunately, you cannot do that by code, and that's the answer. Think of it this was, Excel does not trust VBA coding, and you are trying to have it trust through VBA coding... will not work. You have to manually Trust VBA using Excel options.
0
 
twarrenbAuthor Commented:
The question was poorly worded.  What I'm looking for is VB code that can be run in Microsoft Access 2010 that will designate a specified folder as being a trusted location.
0
 
Shahid ThaikaSole ProprietorCommented:
I am not sure if Access VBA has in-built commands to add trusted location, but you could try adding it by making appropriate registry entries. If you don't know how to edit the registry using VB, there are many tutorials out there.

All trusted locations are stored in the registry at:
HKEY_CURRENT_USER/Software/Microsoft/Office/14.0/application_name/Security/Trusted Locations

Where "application_name" can be Microsoft Access, Microsoft Excel, etc. Trusted locations are stored in registry entries named Path as String (REG_SZ) value types. With a little bit of discovery, you should be able to add trusted locations through your app.


See the following article for more info...
http://technet.microsoft.com/en-us/library/cc179039(office.14).aspx
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
twarrenbAuthor Commented:
I know that Access VBA has no built-in command and that trusted locations are stored as you describe.  However, I was looking for code that would add trusted locations to the registry.  Thanks for your help/
0
 
Shahid ThaikaSole ProprietorCommented:
Here is a good resource to go through on accessing the registry in VB6... should be the same for VBA
http://www.thescarms.com/vbasic/registry.aspx

Note, many tutorials out there will use something like GetSettings and SaveSettings. This is a limited (and safe) form of accessing the registry in VB, but you need to go through a tutorial such as the above to read/write any value, anywhere in the registry.

Also, do note that the String value type for storing Trusted Locations is different in Office 2010 as opposed to ones in the past. Do take the time to go through the entire article on my previous link reference.
0
 
twarrenbAuthor Commented:
While the expert didn't cite actual code, he or she directed me to tutorials where I can teach myself.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now