Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
in access 2003 I have code that will stop users from printing the sheet.Now
that I have added a macro users can print if they do not enable the macro.Is there anyway to stop this happening? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You need a contingency plan that renders the workbook useless if users do
not enable macros. Here is a sample................ Create a sheet named Dummy with a large message typed in the middle. "You have disabled Macros and this workbook is useless without them. Please close and re-open with macros enabled" Then add these two event codes to Thisworkbook module. Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim sht As Worksheet Application.ScreenUpdating = False Sheets("Dummy").Visible = xlSheetVisible For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True ThisWorkbook.Save End Sub Private Sub Workbook_Open() Dim sht As Worksheet Application.ScreenUpdating = False For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = True Sheets("Dummy").Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Wed, 10 Dec 2008 10:10:01 -0800, Zambian wrote: in access 2003 I have code that will stop users from printing the sheet.Now that I have added a macro users can print if they do not enable the macro.Is there anyway to stop this happening? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Zambian-
You posted your question about access in an excel post. Are you working with Access or Excel? "Gord Dibben" wrote: You need a contingency plan that renders the workbook useless if users do not enable macros. Here is a sample................ Create a sheet named Dummy with a large message typed in the middle. "You have disabled Macros and this workbook is useless without them. Please close and re-open with macros enabled" Then add these two event codes to Thisworkbook module. Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim sht As Worksheet Application.ScreenUpdating = False Sheets("Dummy").Visible = xlSheetVisible For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True ThisWorkbook.Save End Sub Private Sub Workbook_Open() Dim sht As Worksheet Application.ScreenUpdating = False For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = True Sheets("Dummy").Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Wed, 10 Dec 2008 10:10:01 -0800, Zambian wrote: in access 2003 I have code that will stop users from printing the sheet.Now that I have added a macro users can print if they do not enable the macro.Is there anyway to stop this happening? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry . Working in excel 2003
"DStrong" wrote: Zambian- You posted your question about access in an excel post. Are you working with Access or Excel? "Gord Dibben" wrote: You need a contingency plan that renders the workbook useless if users do not enable macros. Here is a sample................ Create a sheet named Dummy with a large message typed in the middle. "You have disabled Macros and this workbook is useless without them. Please close and re-open with macros enabled" Then add these two event codes to Thisworkbook module. Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim sht As Worksheet Application.ScreenUpdating = False Sheets("Dummy").Visible = xlSheetVisible For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True ThisWorkbook.Save End Sub Private Sub Workbook_Open() Dim sht As Worksheet Application.ScreenUpdating = False For Each sht In ActiveWorkbook.Sheets If sht.Name < "Dummy" Then sht.Visible = True Sheets("Dummy").Visible = xlSheetVeryHidden End If Next sht Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Wed, 10 Dec 2008 10:10:01 -0800, Zambian wrote: in access 2003 I have code that will stop users from printing the sheet.Now that I have added a macro users can print if they do not enable the macro.Is there anyway to stop this happening? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Allow users of protected sheet to use macro involving custom filte | Excel Discussion (Misc queries) | |||
how do i force users to first enter data in one cell before anythi | Excel Discussion (Misc queries) | |||
how to enable a macro in protected sheet | Excel Discussion (Misc queries) | |||
Force users to enable macros when open a workbook | New Users to Excel | |||
How can force enable macros to be able to open my workbook? | Excel Discussion (Misc queries) |