Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Cancel printing a worksheet
Actually, I've tried printing by selecting the workbook icon and
printing in the blocked sheet and the entire workbook, I've right clicked on a tab and selected all sheets, I've tried to print when the blocked sheet is the activesheet, and I've selected the "Entire workbook" radio button when any sheet is active, and in all cases Sheet1 does not print. Perhaps I've missed another means to print the entire workbook or the one worksheet. Is there another way to print the whole workbook or a particular worksheet that I have not tested? The code below also works the same without having to identify other worksheets that may be part of the workbook. I've been using these two (2) procedures for some time now in Office 3 and they seem to function as I had desired. I've only recently upgraded to Office 7 on a couple of my computers and haven't tried in that environment yet. Private Sub Workbook_BeforePrint(Cancel As Boolean) If ActiveSheet.Name = "Sheet1" Then MsgBox "Print Error, Unable to Print Sheet1", vbCritical Cancel = True Else Application.DisplayAlerts = False Application.EnableEvents = False ThisWorkbook.Worksheets("Sheet1").Visible = xlVeryHidden Application.Dialogs(xlDialogPrint).Show ThisWorkbook.Worksheets("Sheet1").Visible = xlSheetVisible Application.DisplayAlerts = True Application.EnableEvents = True Cancel = True End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cancel printing a worksheet | Excel Worksheet Functions | |||
Worksheet printing | New Users to Excel | |||
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work | Setting up and Configuration of Excel | |||
printing a worksheet | Excel Discussion (Misc queries) | |||
Worksheet printing | Excel Worksheet Functions |