Solved

How to update the macros security level setting with a vbscript?

Posted on 2010-08-25
3
970 Views
Last Modified: 2013-11-27
I would like to update programmatically the macros security level setting in MS Access 2007.  That is I don't want to go through Access menu toolbar.

Also I would like to run it from a vbscript that will open the Access application and change its macro setting.  

Finally I would like to change the settings back or reset them to default when the application closes.

I would greatly appreciate any assistance.
0
Comment
Question by:yvroger
  • 2
3 Comments
 

Author Comment

by:yvroger
ID: 33525660
By the way I found one way of updating the setting programmatically.

Dim ChangeReg
Set ChangeReg = CreateObject("WScript.Shell")
ChangeReg.regwrite "HKCU\Software\Microsoft\Office\12.0\Access\Security\VBAWarnings", "1", "REG_DWORD"

But it requires modifying the registry settings which the users may not like too much. I would appreciate an alternative to this option.

Thanks,
Yves.
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 33526384
Yves,Think about it: if you could use VBA to directly manipulate macro security, then macro security would be useless against a macro virus :)Your only way to do this is going to involve a registry hack, unless you are going to digitally sign your code with a certificate.Patrick
0
 

Author Closing Comment

by:yvroger
ID: 33534754
Thank you for confirming that there is really no other way to go about it than to update the registry.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run Time Error 3075 15 45
MS Access Tables Linking 6 42
how to address a subform in a form, from inside another subform 2 25
Update Access FrontEnd by Version # 9 25
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now