How to identify in BeforePrint if choice was Preview or Print?

ChgsAllAround

New Member
Joined
Apr 11, 2008
Messages
36
I am needing to run a macro AFTER printing. Since there is no AfterPrint, the only way to do this is to trap with Workbook_BeforePrint, cancel the automatic print/preview, code it manually and followup with the macro. (Excel 2003)

My problem now is knowing if the user chose Preview or Print. I've seen a few close ideas that involve CommandBar, but nothing that would say something like:
Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
If the user picked PrintPreview then
ActiveWindow.ActiveSheet.PrintPreview
else
ActiveWindow.ActiveSheet.PrintOut
end if
Run the macro
end sub

Does anyone know how to tell which was chosen and how I would code it?
Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top