Question : Retrieve Macro security settings Excel 2007

Hi Experts,

How do I retrieve the Excel Macro security settings using VBA from Access 2007?
Even better if I could update them!

Gary

Answer : Retrieve Macro security settings Excel 2007

This is how. The value returned will be 1 to 4.

Sub ReadSecurityLevel()
On Error Resume Next
Dim i_RegKey As String
Dim myWS As Object
  i_RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\Level"
  'access Windows scripting
  Set myWS = CreateObject("WScript.Shell")
  'read key from registry
  RegKeyRead = myWS.RegRead(i_RegKey)
On Error GoTo 0
End Sub

Random Solutions  
 
programming4us programming4us