• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1772
  • Last Modified:

Access 2007 Enable All Macros using vba module

I am distributing an Access front-end 2007 db to 25 user profiles on a terminal server.  This is done on a log-in script whereby the db is placed in a folder C:\Users\UserName\etc.  So Username in folder string is always different.

I need to be able to automate setting macro securtiy to 'enable all macros' in a code module.
Can this be done or if not does someone have a way of setting a registry key through a code module that will do the same job for that user?

1 Solution
Gerwin Jansen, EE MVETopic Advisor Commented:
Windows Registry Editor Version 5.00


Will enable all macro's without warnings for current user.
I take it that each user have to log into the network using there username. It so all you have to do it set the access based on the username of the person logged in. You can accesss the network user name by the following code


This also means that you don't have to set login in the database you just piggy back on the network login.
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
I have almost 1000 Terminal Server users I support running Access apps..

Since this must be down by user, I use a log on script for all users that set the macro security level to low.

I use VBS to add the reg key.

If you would like, I can post the files.
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Fully knocking down macro security might be overkill.
How about adding the location to the trust center.
If you go one layer higher than the user's name, you won't even need to know the username

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security\Trusted Locations\Location0]
"Date"="9/2/2010 6:10 PM"
Paul-bbcAuthor Commented:
Hi gersinjansen as you were the first to respond I'm, running with yours at the moment.  Can the registry key be set using vba module within my Access 2007 app?
Gerwin Jansen, EE MVETopic Advisor Commented:
Yes, this is possible but then you would have to start the Access app first (chicken/egg problem).  The setting is meant to be applied before you start Access, thus preventing macro warnings/popups. I'm using reg settings from a batch file that first calls "regedit /S <regfile>" after which I start the Access app.
Paul-bbcAuthor Commented:
See the problem, until off would get warnings on startup of app, thanks I have enough to sort out this solution now.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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