ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xlDialogPrinterSetup (https://www.excelbanter.com/excel-programming/373250-xldialogprintersetup.html)

Abdul[_2_]

xlDialogPrinterSetup
 
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


moon[_7_]

xlDialogPrinterSetup
 

"Abdul" schreef in bericht
oups.com...
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




Jim Rech

xlDialogPrinterSetup
 
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
"Abdul" wrote in message
oups.com...
| 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
|




All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com