Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Print dialog return help needed

I'm using the following code to handle printing and setting a flag to
confirm printing...

Application.Dialogs(xlDialogPrint).Show 2, 1, 3, PrintQty, , , , ,
, , , , , , True
strPrinted = "Y" 'Set Printed flag to "Y"

I need to capture the return code so as not to set the flag if the
print is cancelled. I tried

dlgAnswer = Application.Dialogs(xlDialogPrint).Show 2, 1, 3,
PrintQty, , , , , , , , , , , True

but the result is a Compile error (expected end of statement after
"Show").

Can anyone offer any suggestions on how to capture a cancel of the
print dialog and still set the default print of 2 copies, collated?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Print dialog return help needed

The variable dlgAnswer needs to be a Variant and parenthesis are needed
around arguments when you are returning a value...

dlgAnswer = Application.Dialogs(xlDialogPrint).Show(2, 1, 3, _
PrintQty, , , , , , , , , , , True)
If dlgAnswer = False Then
Exit Sub
Else
strPrinted = "Y"
End If
--------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"BrianG"
wrote in message
I'm using the following code to handle printing and setting a flag to
confirm printing...

Application.Dialogs(xlDialogPrint).Show 2, 1, 3, PrintQty, , , , ,
, , , , , , True
strPrinted = "Y" 'Set Printed flag to "Y"

I need to capture the return code so as not to set the flag if the
print is cancelled. I tried

dlgAnswer = Application.Dialogs(xlDialogPrint).Show 2, 1, 3,
PrintQty, , , , , , , , , , , True

but the result is a Compile error (expected end of statement after
"Show").
Can anyone offer any suggestions on how to capture a cancel of the
print dialog and still set the default print of 2 copies, collated?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Print dialog return help needed

So simple yet so elusive. Thank you.

Jim Cone wrote:
The variable dlgAnswer needs to be a Variant and parenthesis are needed
around arguments when you are returning a value...

dlgAnswer = Application.Dialogs(xlDialogPrint).Show(2, 1, 3, _
PrintQty, , , , , , , , , , , True)
If dlgAnswer = False Then
Exit Sub
Else
strPrinted = "Y"
End If
--------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"BrianG"
wrote in message
I'm using the following code to handle printing and setting a flag to
confirm printing...

Application.Dialogs(xlDialogPrint).Show 2, 1, 3, PrintQty, , , , ,
, , , , , , True
strPrinted = "Y" 'Set Printed flag to "Y"

I need to capture the return code so as not to set the flag if the
print is cancelled. I tried

dlgAnswer = Application.Dialogs(xlDialogPrint).Show 2, 1, 3,
PrintQty, , , , , , , , , , , True

but the result is a Compile error (expected end of statement after
"Show").
Can anyone offer any suggestions on how to capture a cancel of the
print dialog and still set the default print of 2 copies, collated?


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
Print Dialog Box AmyD Excel Worksheet Functions 1 February 2nd 10 04:28 PM
open print dialog (File --- Print...) snaggy^^ Excel Programming 1 January 21st 06 06:24 PM
printing multiple print areas with a print dialog box LHaro Excel Programming 0 August 17th 05 09:56 PM
Print Dialog Box Ashman Excel Programming 2 September 19th 04 12:01 PM
return a value from a dialog box JonR Excel Programming 1 August 31st 04 10:50 PM


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