View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_1292_] Simon Lloyd[_1292_] is offline
external usenet poster
 
Posts: 1
Default Stop sheet showing when Using Datapig's Force Users to enable macr


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"

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


Trish Smith;587167 Wrote:
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
--
Trish



--
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/sh...d.php?t=162610

Microsoft Office Help