I have some code that runs through and collects some data to print off several sheets. each sheet is printed separately and loops through.
I use some code
Applications.CommandBars.ExecuteMso ("PrintPreviewAndPrint")
to open the print preview page then some code in a form to either print with a click of a button or exit. This works ok but when it's finished looping through I am left with the print preview page still open.
Can you help me with the code to close the print preview page and return to the home tab.
Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint")
'opens the form "ContinuePrinting"
ContinuePrinting.Show
Do
DoEvents
Loop Until ContinuePrinting.Visible
'Wait until the form is closed
Do While ContinuePrinting.Visible
DoEvents
Loop
Application.CommandBars.ExecuteMso ("FilePrintQuick")
Sheets("SeqTaskPrint").Activate
Range("as2").Select
Next WP
Application.CommandBars.??????????????????
