Running Custom Code if "Entire Workbook" is Selected for Printing

R

rfedge

I would like to run some custom VBA code before printing an Excel workbook,
but only if the user has selected the option to print the Entire Workbook.
Does anyone know how I can determine if the user has selected "Entire
Workbook" from the print dialog? (The "BeforePrint" event occurs BEFORE the
print dialog is displayed; I want to run my code AFTER the print dialog has
been displayed, and then only if the user has selected the Entire Workbook be
printed).

Thanks very much!

Rob
 
N

NickHK

That is an Excel (as opposed to a Windows) dialog and Excel does not expose
these settings (in say a JustBeforePrint event), so you cannot tell.
The easiest way would be to fake your own print dialog on a userform and use
that.
If you don't need/want to to the whole thing, maybe a simple:
InpuBox="Are you going to print the whole WB ?"
would surfice in the _BeforePrint event, if you trust the users will answer
correctly.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top