Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Macro Enable/Disable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marcus B - 18 Jan 2006 22:36 GMT
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
Bob Phillips - 18 Jan 2006 23:16 GMT
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

Signature

HTH

Bob Phillips

(remove nothere from email address if mailing direct)

> Hi,
>
[quoted text clipped - 19 lines]
> thanks
> Marcus
Marcus B - 22 Jan 2006 14:50 GMT
Thanks Bob,
Marcus

> You can't absolutely avoid it, but you could make it shorter by changing
> screenupdating .
[quoted text clipped - 35 lines]
> > thanks
> > Marcus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.