Solved

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

Posted on 2010-08-25
3
1,016 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses
Course of the Month4 days, 15 hours left to enroll

635 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