Solved

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

Posted on 2010-08-25
3
980 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Office 365 home questions 7 65
How to use VBA to update a record in a table in MS Access? 12 36
sql statement - 9 24
Delete QueryDef IF it Exists: Access VBA 5 32
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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, 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 …

806 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