Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
code for print dialogue
I am trying to get a print dialogue to appear as part of my code, not just to
print something. In other words, I have code that needs to run, and before it does, I want to make sure the person has a chance to print. That said, if they choose NOT to print, by selecting cancel, I need the code to continue from there. Ideally I'd like the following sequence to occur upon initiation of the macro: 1) quick informational dialogue that says "Warning: Once you run this, you will clear the information on the form. Do you want to continue (you will have a chance to first print)?" 2) if they select no, the whole code stops 3) if they select yes, a print dialogue comes up, giving them the normal options they'd have under ctrl-p 4) if they select to print, it prints, and the code runs (basically takes the data and puts it on a separate, holding sheet 5) if they select to cancel print, the code still runs and cleans the sheet to the holding place Right now, I have it successfully doing the transfer and clearing of data. I need that initial piece of asking the questions, and giving the print dialogue option. Thanks for any help. My recording macro function will only show how to print, not the dialogue option. -- Boris |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
code for print dialogue
Perfect. Many thanks.
-- Boris "Gary L Brown" wrote: If MsgBox("Once you run this, you will clear the " & _ "information on the form." & vbCr & _ "Do you want to continue? " & vbCr & _ "You will have a chance to print first.", _ vbYesNo + vbExclamation, "Warning:") = vbNo Then Exit Sub End If Application.Dialogs(xlDialogPrint).Show HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "BorisS" wrote: I am trying to get a print dialogue to appear as part of my code, not just to print something. In other words, I have code that needs to run, and before it does, I want to make sure the person has a chance to print. That said, if they choose NOT to print, by selecting cancel, I need the code to continue from there. Ideally I'd like the following sequence to occur upon initiation of the macro: 1) quick informational dialogue that says "Warning: Once you run this, you will clear the information on the form. Do you want to continue (you will have a chance to first print)?" 2) if they select no, the whole code stops 3) if they select yes, a print dialogue comes up, giving them the normal options they'd have under ctrl-p 4) if they select to print, it prints, and the code runs (basically takes the data and puts it on a separate, holding sheet 5) if they select to cancel print, the code still runs and cleans the sheet to the holding place Right now, I have it successfully doing the transfer and clearing of data. I need that initial piece of asking the questions, and giving the print dialogue option. Thanks for any help. My recording macro function will only show how to print, not the dialogue option. -- Boris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what is print to file in print dialogue box and its useage? | Excel Worksheet Functions | |||
Suppressing print dialogue box | Excel Discussion (Misc queries) | |||
Closing the Print Dialogue box | Excel Programming | |||
Need VBA code for "Open Dialogue" box | Excel Discussion (Misc queries) | |||
how can I add a print dialogue? | Excel Programming |