Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro Enable/Disable

Hi,

I am trying to ensure that a user can only use my spreadsheet if they enable
macros. I have used the workbook close event to set all the useful sheets to
veryhidden and have a warning sheet visible advising that they must enable
macros.

The problem is that the workbook open event that sets the warning sheet to
veryhidden does not immediately hide the sheet. How can I ensure that the
user dosen't see this sheet if they have enabled the macros.

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheet.Visible = xlSheetVisible
Sheet28.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
Sheet6.Visible = xlSheetVeryHidden
Call ExitEditMode '(sub also has Application.ScreenUpdating = True/false).
Application.ScreenUpdating = True
End Sub

thanks
Marcus
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro Enable/Disable

You can't absolutely avoid it, but you could make it shorter by changing
screenupdating .

Private Sub Workbook_Open()
Sheet.Visible = xlSheetVisible
Application.ScreenUpdating False
Sheet28.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
Sheet6.Visible = xlSheetVeryHidden
Call ExitEditMode '(sub also has Application.ScreenUpdating = True/false).
Application.ScreenUpdating = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Marcus B" <Marcus wrote in message
...
Hi,

I am trying to ensure that a user can only use my spreadsheet if they

enable
macros. I have used the workbook close event to set all the useful sheets

to
veryhidden and have a warning sheet visible advising that they must enable
macros.

The problem is that the workbook open event that sets the warning sheet

to
veryhidden does not immediately hide the sheet. How can I ensure that the
user dosen't see this sheet if they have enabled the macros.

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheet.Visible = xlSheetVisible
Sheet28.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
Sheet6.Visible = xlSheetVeryHidden
Call ExitEditMode '(sub also has Application.ScreenUpdating = True/false).
Application.ScreenUpdating = True
End Sub

thanks
Marcus



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro Enable/Disable

Thanks Bob,
Marcus

"Bob Phillips" wrote:

You can't absolutely avoid it, but you could make it shorter by changing
screenupdating .

Private Sub Workbook_Open()
Sheet.Visible = xlSheetVisible
Application.ScreenUpdating False
Sheet28.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
Sheet6.Visible = xlSheetVeryHidden
Call ExitEditMode '(sub also has Application.ScreenUpdating = True/false).
Application.ScreenUpdating = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Marcus B" <Marcus wrote in message
...
Hi,

I am trying to ensure that a user can only use my spreadsheet if they

enable
macros. I have used the workbook close event to set all the useful sheets

to
veryhidden and have a warning sheet visible advising that they must enable
macros.

The problem is that the workbook open event that sets the warning sheet

to
veryhidden does not immediately hide the sheet. How can I ensure that the
user dosen't see this sheet if they have enabled the macros.

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheet.Visible = xlSheetVisible
Sheet28.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
Sheet6.Visible = xlSheetVeryHidden
Call ExitEditMode '(sub also has Application.ScreenUpdating = True/false).
Application.ScreenUpdating = True
End Sub

thanks
Marcus




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
Enable/Disable Macro Pop-Up juamig Excel Discussion (Misc queries) 5 April 12th 10 02:57 PM
enable/disable macro RICK Excel Discussion (Misc queries) 4 June 15th 06 07:55 PM
Disable/ Enable Macro Stephen[_7_] Excel Programming 1 October 5th 04 06:22 PM
Enable/Disable Macro Brandon[_5_] Excel Programming 0 June 1st 04 06:36 PM
macro disable and enable. paul[_12_] Excel Programming 1 January 9th 04 01:29 PM


All times are GMT +1. The time now is 10:05 AM.

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

About Us

"It's about Microsoft Excel"