Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling Macros in Excel 6

Status
Not open for further replies.

snorky

Programmer
Jun 5, 2001
58
GB
Does anyone know of a way of enabling macro support automatically as a sheet opens so the user can't disable the macro via the virus warning dialog at startup ? ? ?
 
Create a .vbs script file that changes the registry, and send it with your table.
You must check the path in the registry...

"Disabling 'Macro Virus Protection'
=========================

With Word, the macro virus protection can be disabled with the
following command:
Options.VirusProtection = False

To my knowledge, there is no such command for Excel. However, this
option can be changed with a reg hack that could be initiated from a
batch file or from a VBA macro Shell command. On my PC, the "Macro
Virus Protection" option is stored as a dword value in the following
registry key:

[HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Excel\Microsoft
Excel]

To enable the virus protection, use:
"Options6"=dword:00000008

To disable the virus protection, use:
"Options6"=dword:00000000

This may not be exactly the same for every PC as "Options6" controls
several options depending on the value of the first four bits. See
below for details:

bit 0 Show Name part of Chart Tips
bit 1 Show Value part of Chart Tips
bit 2 Intellimouse Roll action: 0 = scroll, 1= zoom
bit 3 Macro Virus Protection
bit 4-15 (Reserved)

For more details, refer to the following TechNet article:
Q169811 - XL97: Using the Policy Editor to Force Macro Virus
Protection
"

ide
 
Great - thanx for that !

Snorky X-)
 
Obtain a digital certificate. Try or you can produce your own self-signed certificate with selfcert.exe (Search your hard drive).

Sign your VBA project with your digital signature.

Set your digital certificate as a trusted source on your users PC.

Voila. Your users will no longer recieve the Security Warning when opening a macro-infested document signed with your digital signature. Jon Hawkins
 
We have Office XP on Win2000 (actually Citrix Metaframe) and are suffering the same problem in Excel.

We have used selfcert.exe to create a code-signing digital signature and have signed the Excel macros accordingly. However when a different user updates the workbook and saves it (even if though they haven't amended the macros) it removes the signature, telling them that they have amended the project. It then naturally disables the macros when they next open that workbook, so that I end up re-signing the workbooks on an almost daily basis.

The company that supports our installation has been looking into this problem for months without success and I am desperate for a solution. I cannot believe that everyone else is living with this problem, so how are others getting around this issue?

Thanks,
Chris.
 
like above ...

use a vbscript file (or an exe) to change the setting of security in the registry (post in a mail attachement, or insert into your document a link to the script file). If direct running from a mail attachement is disabled, zip this file and send that zip to users. you can run this via a logon script also if you are a net admin.

office 9 (2000):
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Security\Level

and

HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security\Level

level=3 High, =2 medium, =1 low security option.

something like this:
Enable Macros (in a separated file):
Sub main()
Dim wscr
Set wscr = CreateObject("WScript.Shell")
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Security\Level", 1, "REG_DWORD"
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security\Level", 1, "REG_DWORD"
End Sub


or DisableMacros:
Sub main()
Dim wscr
Set wscr = CreateObject("WScript.Shell")
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Security\Level", 3, "REG_DWORD"
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security\Level", 3, "REG_DWORD"
End Sub

change the registry path to the Off XP rpath
ide
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top