Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Controlling the 'cancel' button in xldialogprint

I've got a button at the bottom of a sheet called 'Print'. Logically one
would only push that button when they really wanted to print the sheet, but
some click and are suprised when the print dialog comes up.

After a logical person clicks the button on purpose and prints the form a
message box asks to verify if the sheet printed before finishing the code.
The problem is that if you click cancel in the print dialog the code
continues to the print confirmation.

I could add a msgbox before opening 'Print' asking if they really want to
print, but sometimes people even get past that.

Is there any way for me to say: "if cancel button in print dialog is true,
then exit sub"?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Controlling the 'cancel' button in xldialogprint

res = application.Dialogs(xlDialogPrint).show
if res = False then
' dialog cancelled
exit sub
End if

--
Regards,
Tom Ogilvy

"JNW" wrote in message
...
I've got a button at the bottom of a sheet called 'Print'. Logically one
would only push that button when they really wanted to print the sheet,

but
some click and are suprised when the print dialog comes up.

After a logical person clicks the button on purpose and prints the form a
message box asks to verify if the sheet printed before finishing the code.
The problem is that if you click cancel in the print dialog the code
continues to the print confirmation.

I could add a msgbox before opening 'Print' asking if they really want to
print, but sometimes people even get past that.

Is there any way for me to say: "if cancel button in print dialog is true,
then exit sub"?

Thank you



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
Controlling Radio Button rk0909 Excel Discussion (Misc queries) 2 January 27th 09 11:31 PM
Capture a cancel button Lp12 Excel Programming 8 September 6th 05 05:58 AM
Cancel button IamHaxer Excel Programming 3 June 24th 04 05:19 PM
Option button controlling text box Ken McLennan[_3_] Excel Programming 12 May 7th 04 11:03 PM
Cancel Button Matt Excel Programming 3 February 3rd 04 11:23 PM


All times are GMT +1. The time now is 06:49 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"