Solved

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

Posted on 2010-08-25
3
960 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for confirming that there is really no other way to go about it than to update the registry.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 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

9 Experts available now in Live!

Get 1:1 Help Now