Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Macro/Trust Center Settings

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro/Trust Center Settings

In 2003 how did you display your message to users?

If macro security was set at High, no code would run.

I would think you could do the same in 2007


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 13:35:04 -0700, Martin
wrote:

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Macro/Trust Center Settings

The file was set up in Excel 2003 to have all sheets hidden except for a
message. If security was set to High, the WorkbookOpen event would not fire,
displaying the message. If security was set to Medium or Low, the event
would hide the message sheet and unhide the other sheet(s). All this was
based on an idea I got from this forum.

I have tried the file with Excel 2007, but it does not work the same way.
It appears that the WorkbookOpen event fires regardless of how the macro
security is set in the Trust Center. This hides the message and makes it
appear that the file is ready for use, when it really is not.

Based on my testing, it looks like Excel 2007 will display different
messages/windows depending on which of the security settings is selected. I
was hoping to read those settings (not to change the settings) to display a
message to tell the user how to make the necessary changes to allow the file
to function for their workstation.

Thanks.

"Gord Dibben" wrote:

In 2003 how did you display your message to users?

If macro security was set at High, no code would run.

I would think you could do the same in 2007


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 13:35:04 -0700, Martin
wrote:

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro/Trust Center Settings

Martin

I cannot replicate the problem.

I built a workbook in 2007 and added this code to Thisworkbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

Private Sub Workbook_Open()
Dim sht As Worksheet
Application.ScreenUpdating = False
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = True
Sheets("Dummy").Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
End Sub

I then set security to "Disable all macros without notification"

No code runs when I open the workbook and all I see is "Dummy" sheet with my
message instructing users how to enable macros.


Gord

On Tue, 17 Mar 2009 06:12:06 -0700, Martin
wrote:

The file was set up in Excel 2003 to have all sheets hidden except for a
message. If security was set to High, the WorkbookOpen event would not fire,
displaying the message. If security was set to Medium or Low, the event
would hide the message sheet and unhide the other sheet(s). All this was
based on an idea I got from this forum.

I have tried the file with Excel 2007, but it does not work the same way.
It appears that the WorkbookOpen event fires regardless of how the macro
security is set in the Trust Center. This hides the message and makes it
appear that the file is ready for use, when it really is not.

Based on my testing, it looks like Excel 2007 will display different
messages/windows depending on which of the security settings is selected. I
was hoping to read those settings (not to change the settings) to display a
message to tell the user how to make the necessary changes to allow the file
to function for their workstation.

Thanks.

"Gord Dibben" wrote:

In 2003 how did you display your message to users?

If macro security was set at High, no code would run.

I would think you could do the same in 2007


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 13:35:04 -0700, Martin
wrote:

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Macro/Trust Center Settings

If I followed your comment, that is the problem. The WorkbookOpen event does
not fire. I am using the following code in my WorkBookOpen event:
Application.ScreenUpdating = False
Worksheets("INSTRUCT").Visible = True
Worksheets("MACROWARNING2007").Visible = False
Application.ScreenUpdating = True

It is intended to hide the MacroWarning and display the Instruct sheet if
security is set properly.

With Excel 2007 it appears that the WorkBookOpen event never fires unless
the security setting is set to Enable all macros. (I may have misspoken
earlier.)

Combine that with the way Excel 2007 displays messages (or not) depending on
the macro security setting makes dealing with this more difficult. This is
what I have seen for the various settings:
"Disable all without notification"-- no messaages are displayed indicating that macros will not work. With my code, the MacroWarning should and does display.
"Disable all with notification"--most of the time, security bar at the top of the screen appears. [See note below.]
"Disable all except signed"--this works like the "Disable all without notification".


The odd thing I found with the "Disable all with notification" is that most
of the time the security bar is displayed above the edit bar. Other times, a
security window appears much like the window that was displayed with Excel
2003 to enable macros.

All of these can require different user intervention to enable the macros in
the file. So being able to read the macro security setting would allow the
appropriate instructions to be displayed.

Thanks.



"Gord Dibben" wrote:

Martin

I cannot replicate the problem.

I built a workbook in 2007 and added this code to Thisworkbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

Private Sub Workbook_Open()
Dim sht As Worksheet
Application.ScreenUpdating = False
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = True
Sheets("Dummy").Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
End Sub

I then set security to "Disable all macros without notification"

No code runs when I open the workbook and all I see is "Dummy" sheet with my
message instructing users how to enable macros.


Gord

On Tue, 17 Mar 2009 06:12:06 -0700, Martin
wrote:

The file was set up in Excel 2003 to have all sheets hidden except for a
message. If security was set to High, the WorkbookOpen event would not fire,
displaying the message. If security was set to Medium or Low, the event
would hide the message sheet and unhide the other sheet(s). All this was
based on an idea I got from this forum.

I have tried the file with Excel 2007, but it does not work the same way.
It appears that the WorkbookOpen event fires regardless of how the macro
security is set in the Trust Center. This hides the message and makes it
appear that the file is ready for use, when it really is not.

Based on my testing, it looks like Excel 2007 will display different
messages/windows depending on which of the security settings is selected. I
was hoping to read those settings (not to change the settings) to display a
message to tell the user how to make the necessary changes to allow the file
to function for their workstation.

Thanks.

"Gord Dibben" wrote:

In 2003 how did you display your message to users?

If macro security was set at High, no code would run.

I would think you could do the same in 2007


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 13:35:04 -0700, Martin
wrote:

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro/Trust Center Settings

I have no further ideas or suggestions.

I don't know of a way to capture a user's security settings.

And you certainly did "misspoke earlier"<g


Gord

On Tue, 17 Mar 2009 09:28:07 -0700, Martin
wrote:

If I followed your comment, that is the problem. The WorkbookOpen event does
not fire. I am using the following code in my WorkBookOpen event:
Application.ScreenUpdating = False
Worksheets("INSTRUCT").Visible = True
Worksheets("MACROWARNING2007").Visible = False
Application.ScreenUpdating = True

It is intended to hide the MacroWarning and display the Instruct sheet if
security is set properly.

With Excel 2007 it appears that the WorkBookOpen event never fires unless
the security setting is set to Enable all macros. (I may have misspoken
earlier.)

Combine that with the way Excel 2007 displays messages (or not) depending on
the macro security setting makes dealing with this more difficult. This is
what I have seen for the various settings:
"Disable all without notification"-- no messaages are displayed indicating that macros will not work. With my code, the MacroWarning should and does display.
"Disable all with notification"--most of the time, security bar at the top of the screen appears. [See note below.]
"Disable all except signed"--this works like the "Disable all without notification".


The odd thing I found with the "Disable all with notification" is that most
of the time the security bar is displayed above the edit bar. Other times, a
security window appears much like the window that was displayed with Excel
2003 to enable macros.

All of these can require different user intervention to enable the macros in
the file. So being able to read the macro security setting would allow the
appropriate instructions to be displayed.

Thanks.



"Gord Dibben" wrote:

Martin

I cannot replicate the problem.

I built a workbook in 2007 and added this code to Thisworkbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

Private Sub Workbook_Open()
Dim sht As Worksheet
Application.ScreenUpdating = False
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = True
Sheets("Dummy").Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
End Sub

I then set security to "Disable all macros without notification"

No code runs when I open the workbook and all I see is "Dummy" sheet with my
message instructing users how to enable macros.


Gord

On Tue, 17 Mar 2009 06:12:06 -0700, Martin
wrote:

The file was set up in Excel 2003 to have all sheets hidden except for a
message. If security was set to High, the WorkbookOpen event would not fire,
displaying the message. If security was set to Medium or Low, the event
would hide the message sheet and unhide the other sheet(s). All this was
based on an idea I got from this forum.

I have tried the file with Excel 2007, but it does not work the same way.
It appears that the WorkbookOpen event fires regardless of how the macro
security is set in the Trust Center. This hides the message and makes it
appear that the file is ready for use, when it really is not.

Based on my testing, it looks like Excel 2007 will display different
messages/windows depending on which of the security settings is selected. I
was hoping to read those settings (not to change the settings) to display a
message to tell the user how to make the necessary changes to allow the file
to function for their workstation.

Thanks.

"Gord Dibben" wrote:

In 2003 how did you display your message to users?

If macro security was set at High, no code would run.

I would think you could do the same in 2007


Gord Dibben MS Excel MVP


On Mon, 16 Mar 2009 13:35:04 -0700, Martin
wrote:

I have a spreadsheet created in Excel 2003 in which I display a message to
users indicating that the macro security level was not set to either Medium
or Low. Basically, it functions because the WorkbookOpen event does not fire
if the setting is on High. Now that I have moved "up" to Excel 2007, the
process does not work to display the message.

Is there a way to simply read the setting in the Trust Center/Macro
Security/Macro Settings? I am not looking to change the setting, just be
able to see what it is so that I can display an appropriate message.

Thanks.





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
what is the file name where my settings of the trust center? Brigitte[_2_] Excel Discussion (Misc queries) 0 March 5th 09 05:11 AM
Macro Trust Center Un-Available DOUG Excel Discussion (Misc queries) 3 January 22nd 09 03:39 PM
Trust Center settings via GPO D2k Setting up and Configuration of Excel 0 January 14th 08 03:03 PM
Macro trust center problems in Excel 2007 David Walker Setting up and Configuration of Excel 1 January 9th 08 01:13 AM
Trust center log David Walker Setting up and Configuration of Excel 1 January 5th 08 02:06 AM


All times are GMT +1. The time now is 06:11 AM.

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"