Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-08-25
3
Medium Priority
?
1,046 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 93

Accepted Solution

by:
Patrick Matthews earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

876 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