Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop sheet showing when Using Datapig's Force Users to enable macr
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stop sheet showing when Using Datapig's Force Users to enable
Hi Simon,
That does the job! Thank you. -- Trish "Simon Lloyd" wrote: 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
force users to enable macro so sheet cannot be printed | Excel Discussion (Misc queries) | |||
Programmatically opening workbooks in macros brings up Enable Macr | Excel Programming | |||
Force users to enable macros when open a workbook | New Users to Excel | |||
How to realize "enable macro" by VBA when opening a file with macr | Excel Programming | |||
Force Enable Macros | Excel Programming |