ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error sheet when macro's are not activated (https://www.excelbanter.com/excel-programming/356844-error-sheet-when-macros-not-activated.html)

jgmiddel

Error sheet when macro's are not activated
 

Hi,

Im working on a file, the macro's must be actived. If not, the use
should see the "errorsheet". I guess this should be the "openingspage
of the file. If the macro's are activated, the sheet Welcome i
selected. So far so good.

But, the screen blinks and that is not what I want. Is there
solution?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheets("Error").Visible = True
Sheets("Error").Select
Sheets("Welkom").Visible = xlSheetVeryHidden
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Welkom").Visible = True
Sheets("Welkom").Select
Sheets("Error").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Su

--
jgmidde
-----------------------------------------------------------------------
jgmiddel's Profile: http://www.excelforum.com/member.php...fo&userid=3271
View this thread: http://www.excelforum.com/showthread.php?threadid=52546



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

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