set macro security to low programmatically

C

Chlaris

Dear all,
Is it possible to set macro security to low programmatically?Thanks.Chlaris
 
T

Tom van Stiphout

On Tue, 29 Dec 2009 11:32:10 +0700, "Chlaris"

There are a few registry keys you can set BEFORE you run your app, for
example by your setup program. See below for details.
IMHO it would be much better to digitally sign your app, so this is
not needed.

Root:
Local Machine
Key:
Local Machine Software\Microsoft\Office\11.0\Access\Security
Name:
level
Value
#00000001

Root:
Local Machine
Key:
Local Machine SOFTWARE\Microsoft\Jet\4.0\Engines
Name:
SandBoxMode
Value
#00000002

-Tom.
Microsoft Access MVP
 
T

Tom Wickerath

Hi Chlaris,

I'm fairly certain this is possible using software to create an installation
package, such as Wise
(http://www.symantec.com/business/wise-installation-express) or
InstallShield (http://www.flexerasoftware.com/products/installshield.htm).
You might even be able to do this using the free Inno installer:
http://www.jrsoftware.org/isinfo.php. Presumably, the installation packages
would require admin rights to run.

A quick search of the registry indicates that the following keys need to be
set to have low security in Access 2003:

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Security]
"DontTrustInstalledFiles"=dword:00000000
"Level"=dword:00000001

Certainly you are not going to be able to change this key using VBA, unless
the VBA code is able to be run. Otherwise, don't you think that macro script
kiddies would be the first to exploit such a weakness to use in their viruses?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
T

Tom Wickerath

PS. If you are using Access 2007, you can create an Autoexec macro that will
warn the user if the application is not being run from a trusted folder. I
"borrowed" an example from the Access 2007 book written by John Viescas and
Jeff Conrad, in a sample database that I have available for download. Check
out the .accdb version of this sample:

http://home.comcast.net/~tutorme2/samples/tmpwrkdb.zip


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
 
A

Arvin Meyer [MVP]

Chlaris said:
Dear all,
Is it possible to set macro security to low
programmatically?Thanks.Chlaris

As others have mentioned, you cannot do it from VBA. Save the following text
in a text file named "Security.reg" and double-click on it.or run it as part
of your install script.

Here are the settings for SandBoxMode:

Setting Description
0 Sandbox mode is disabled at all times.
1 Sandbox mode is used for Access applications, but not for
non-Access Applications.
2 Sandbox mode is used for non-Access applications, but not for
Access Applications. (This is the default value.)
3 Sandbox mode is used at all times.

and here's the script I use. (The semi-colons are comments):


REGEDIT4

; This will kill the Access 2003 security warnings
; Note: you need a carriage return after the last line

[[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\11.0\Access\Security]
"Level"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines]
"SandBoxMode"=dword:00000002
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top