xlDialogPrinterSetup

A

Abdul

hi,

I want to use Application.Dialogs(xlDialogPrinterSetup).Show and able
to print or cancel print

If I use Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Chart1").PrintOut

then it prints the chart even if I press cancel button from the
setup??!!!

Thanks
 
M

moon

Abdul said:
hi,

I want to use Application.Dialogs(xlDialogPrinterSetup).Show and able
to print or cancel print

If I use Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Chart1").PrintOut

then it prints the chart even if I press cancel button from the
setup??!!!

Thanks


Same question was asked two days ago for a FileOpen-dialog.
This one did the job:

Public Sub FileOpenDlg()
If Application.Dialogs(xlDialogOpen).Show = False Then
MsgBox "Cancel pressed"
Exit Sub
End If

'code continues here if not cancelled

End Sub
 
J

Jim Rech

Once a built-in dialog is displayed it has control, not your macro. The
user can do anything he could if he had opened the dialog manually.

--
Jim
| hi,
|
| I want to use Application.Dialogs(xlDialogPrinterSetup).Show and able
| to print or cancel print
|
| If I use Application.Dialogs(xlDialogPrinterSetup).Show
| Sheets("Chart1").PrintOut
|
| then it prints the chart even if I press cancel button from the
| setup??!!!
|
| Thanks
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top