Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Registry Key for Macro Security Level? ph8[_16_] Excel Programming 4 February 3rd 06 03:51 PM
set macro security level through VBA bill_morgan Excel Programming 4 August 1st 05 06:29 PM
Detecting Macro Security Level Ed Ferrero[_5_] Excel Programming 0 June 15th 04 01:22 PM
Using VBA to change macro security level Tracey[_4_] Excel Programming 4 January 23rd 04 07:20 PM
Macro to change security level Michael Miazga[_2_] Excel Programming 2 July 21st 03 08:39 PM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"