ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   print event (https://www.excelbanter.com/excel-programming/327725-print-event.html)

xlcharlie

print event
 
I want my beforeprint event code to execute only when the user prints the
document, not when the user switches to print preview. I tried creating a
button that would call a procedure to disable events, switch to print
preview, then re-enable events, but the user can then print from print
preview without executing the code for the beforeprint event.

Chip Pearson

print event
 
The BeforePrint is rather anemic; it doesn't tell you what is
being printed (a range, a sheet, or a workbook) and doesn't
distinguish between printing and print preview. I don't think
there is any solid way to do what you want.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"xlcharlie" wrote in
message
...
I want my beforeprint event code to execute only when the user
prints the
document, not when the user switches to print preview. I tried
creating a
button that would call a procedure to disable events, switch to
print
preview, then re-enable events, but the user can then print
from print
preview without executing the code for the beforeprint event.





All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com