Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Not a 2nd print from the preview

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
print preview v page break preview SamB Excel Discussion (Misc queries) 0 November 16th 06 05:09 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM
Why does macro speed slow after Excel Print or Print Preview? Larry A[_3_] Excel Programming 6 May 16th 05 11:22 AM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"