I'm using COM in LotusScript (Lotus Notes) to make Excel print several sheets in one workbook to PDFCreator, then make PDFCreator combine then into one PDF. The problem is that calling Excel's PrintOut method immediately followed by PDFCreator's cCombineAll method results in one or more sheets being omitted from the PDF. It seems like Excel's PrintOut method returns before printing is complete.
Putting a Sleep in my code works, but may not be reliable as the printing time varies, so...
Is there any Excel property or method I can call to determine whether printing has finished?
Alternately, is there a way make the PrintOut method block until printing is finished?
I haven't been able to find an answer in Excel's VBA Help.