ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro-Security level value (https://www.excelbanter.com/excel-programming/393197-macro-security-level-value.html)

avi

Macro-Security level value
 
Hello,

Is there a way to get in VBA or VB6 the Macro-Security level actual
value (High, low...).

Tanks
Avi


Jim Rech

Macro-Security level value
 
You'd have to read the registry. The item is "Level" under
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\E xcel\Security for Excel
2003.



avi

Macro-Security level value
 
Thanks a lot!

I understand that i have to use the API RegOpenKeyEx to retrieve the
value. Could you help me further with the proper parameters to pass to
the function?

Thanks again
Avi


Bob Phillips

Macro-Security level value
 
This reads the key in a XP/2002 version of Excel

Dim oWSH As Object
Dim sResult

Set oWSH = CreateObject("WScript.Shell")

On Error Resume Next
sResult =
oWSH.RegRead("HKCU\Software\Microsoft\Office\10.0\ Excel\Security\Level")
On Error GoTo 0
If Err.Number < 0 Or sResult = "" Then
MsgBox "Read key error"
Else
MsgBox sResult
End If
Err.Clear



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"avi" wrote in message
ps.com...
Thanks a lot!

I understand that i have to use the API RegOpenKeyEx to retrieve the
value. Could you help me further with the proper parameters to pass to
the function?

Thanks again
Avi





All times are GMT +1. The time now is 08:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com