Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
The following VBA macro captures the BeforePrint event so thet it prints only the area I defined. The macro presents a PrintPreview to the user, but in this Preview window there is another Print button which allows the user to run a second print. I need to forbid that. How can I deactivate this Print button in the Preview window ? Thanks for your help, Robert --------------------------------------------------- Private Sub Workbook_BeforePrint(Cancel As Boolean) Cancel = True Application.EnableEvents = False Dim Clic As Integer Application.ScreenUpdating = False ActiveWorkbook.Protect Structu=False, Password:="XXX" With Worksheets("DTimpr") .Activate .Visible = True .PageSetup.PrintArea = "DTfinale" MsgBox "Click on the CLOSE button to close the preview to print out" .PrintPreview Clic = MsgBox("After this previw, do you want to print?", vbYesNo, "Printing of the DT") If Clic = vbYes Then .PrintOut Copies:=1, Collate:=True End If .Visible = xlVeryHidden End With Worksheets("DTForm").Activate ActiveWorkbook.Protect Structu=True, Password:="XXX" Application.ScreenUpdating = True Application.EnableEvents = True End Sub End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
First page of Excel sheerepeats in print layout or print preview | Excel Discussion (Misc queries) | |||
Print and Print Preview Graphic Moving Resizing 2007/2003 | Excel Discussion (Misc queries) | |||
print preview v page break preview | Excel Discussion (Misc queries) | |||
cell borders that I create dont show on print preview or print | Excel Discussion (Misc queries) | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming |