Error sheet when macro's are not activated

J

jgmiddel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top