Equivalent of Workbook_BeforePrint in C++?

C

ccccoder

I had a plugin for Excel written in C++, with an event sink. Another
functionality request to add was to validate certain data before printing the
workbook. If the data can not be validated correctly, then the print job must
be canceled.

The event sink can get the print event correctly in the Invoke() method
(inherited from IDispatch), but how can I cancel the print job? In VBA, you
can set the cancel flag to true in Workbook_BeforePrint subroutine, but there
does not seem to have an equivalent in C++.

The question is, how can I cancel the print job from inside the Invoke()
function, or at least, tell Excel that it should not continue with printing?

Thanks in advance
 

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