Re: xlDialogPrint
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Fri, 17 Oct 2008 08:27:13 -0500
The cancel button tells you that the user didn't want to change printers--not
that they didn't want to print.
Maybe you could show this dialog and remove your .printout statement:
Application.Dialogs(xlDialogPrint).Show
Or you could ask:
dim resp as long
....
Application.Dialogs(xlDialogPrinterSetup).Show
resp = Msgbox(Prompt:="still want to print", buttons:=vbyesno)
if resp = vbyes then
Active***.Range("A3:P" & LastRow).PrintOut
end if
Jim G wrote:
Jim/Dave, Thanks guys.
This solved a problem for me. However, when the cancel button is press it
still prints. Is there a way to have the print request cancelled. Here's
what I have
Sub PrintSelection()
'
' Print Selected Range Macro
'
Dim LastRow As Long
Application.ScreenUpdating = False
With Worksheets("Jobs")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Application.Dialogs(xlDialogPrinterSetup).Show
Active***.Range("A3:P" & LastRow).PrintOut
Range("A3").Select
Application.ScreenUpdating = True
End Sub
Cheers
--
Jim
"Dave Peterson" wrote:
How about using a different dialog?
Application.Dialogs(xlDialogPrinterSetup).Show
"doodles82a@xxxxxxxxx" wrote:
Good afternoon. I used VBA to format the pages I want printed.
However, when they press the Print icon I developed for them, I want
the xlDialogPrint to appear so they can select an appropriate printer.
The xlDialogPrint box appears, but I only want them to use the dialog
box to select a printer. Once they select the printer and press OK,
the worksheets will print based on the print definitions in the VBA. I
don't want them to be able to adjust any of the other arguments, as
I've already defined those arguments in the VBA code. Is it possible
for me to use VBA code to disable all arguments of the xlDialogPrint
box, except the printer selection argument? Thanks for your time.
Michael
--
Dave Peterson
--
Dave Peterson
.
- Follow-Ups:
- Re: xlDialogPrint
- From: Jim G
- Re: xlDialogPrint
- References:
- Re: xlDialogPrint
- From: Jim G
- Re: xlDialogPrint
- Prev by Date: RE: Start Excel anytime
- Next by Date: Re: How to Print varied page numbers in a single print job without col
- Previous by thread: Re: xlDialogPrint
- Next by thread: Re: xlDialogPrint
- Index(es):