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!
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!