Stop sheet showing when Using Datapig's Force Users to enable macr

T

Trish Smith

Hi,

I think this is probably not do-able

I'm using Datapig Technologies example to force users to enable macros

When the workbook is closed all sheets other than a warning sheet are very
hidden so that if the workbook is opened with macros disabled then the user
can only see a warning sheet saying to close and open with macros enabled.

Then on opening with macros enabled the waring sheet is very hidden and the
other sheets can be seen.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheets("Warning").Visible = True
Sheets("Sheet1").Visible = xlVeryHidden

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Sheet1").Visible = True
Sheets("Warning").Visible = xlVeryHidden

This works beautifully but when the workbook is closed the user sees the
warning sheet (and panics!) also confusing for the user is the fact that if
they save then close they are asked if they want to save their changes but
they are not aware that they have made any changes.

Does anyone have any suggestions?

I've put a sentence on the warning sheet saying if closing then save
normally but if opening scroll down to a warning about enabling macros.
Clunky.

Cheers
 
T

Trish Smith

Hi Simon,
That does the job!
Thank you.

--
Trish


Simon Lloyd said:
Simply change this:
Code:
--------------------

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheets("Warning").Visible = True
Sheets("Sheet1").Visible = xlVeryHidden

--------------------
to this:
Code:
--------------------

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Warning").Visible = True
Sheets("Sheet1").Visible = xlVeryHidden
Application.ScreenUpdating = False
Msgbox "Please ignore warning sheet, this is for reset purposes!",vbokonly,"Close Notice"

--------------------

Hi,

I think this is probably not do-able

I'm using Datapig Technologies example to force users to enable macros

When the workbook is closed all sheets other than a warning sheet are
very
hidden so that if the workbook is opened with macros disabled then the
user
can only see a warning sheet saying to close and open with macros
enabled.

Then on opening with macros enabled the waring sheet is very hidden and
the
other sheets can be seen.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Sheets("Warning").Visible = True
Sheets("Sheet1").Visible = xlVeryHidden

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("Sheet1").Visible = True
Sheets("Warning").Visible = xlVeryHidden

This works beautifully but when the workbook is closed the user sees
the
warning sheet (and panics!) also confusing for the user is the fact
that if
they save then close they are asked if they want to save their changes
but
they are not aware that they have made any changes.

Does anyone have any suggestions?

I've put a sentence on the warning sheet saying if closing then save
normally but if opening scroll down to a warning about enabling macros.
Clunky.

Cheers


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=162610

Microsoft Office Help

.
 

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