View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 7
Default How to test Excel 2003 & 2007 macro security level

I want to test Excel's macro security level before loading a worksheet with
macros.

What's the "best" way to do this?

In 2003, I believe I can test the Registry
HKEY_CURRENT_USER\Software\Microsoft\Office\9\Exce l\Security\Level

In 2007, it appears from my testing that the same test would be on
HKEY_CURRENT_USER\Software\Microsoft\Office\12\Exc el\Security\VBAWarnings

I'd have preferred to use the Application.AutomationSecurity property rather
than the registry, but testing it under 2007 (Vista) it doesn't seem to
change when I change the security level in Excel's UI.

I'm quite surprised that apparently a non-Administrative Vista user can
simply change the VBAWarnings registry variable to enable macros. Seems like
a weak link in the security model.

Anyone have any suggestions?