xlDialogPrinterSetup

  • Thread starter Thread starter Abdul
  • Start date Start date
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
 
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
 
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
|
 
Back
Top