I am developing an application to automatically generate Excel to PDF. From time to time (and for no apparent reason, the following pop-up window appears during program execution:
The printer driver host for 32-bit applications stops working.

and, shortly afterwards:
Printer Setup

What if anything I need to do here? My application is not too complicated. An error always (100%) occurs on this line:
_application.ActiveWorkbook.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, pdfTemplatePath, Excel.XlFixedFormatQuality.xlQualityStandard, _, _, 1, pdfPrintAreaEnd);
where the variables in question are:
Excel := Microsoft.Office.Intertop.Excel _application := Excel.Application _ := System.Type.Missing pdfPrintAreaEnd := int 6
The exception message is as follows:
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
What's going on here? And, more importantly: why does this happen only every time?
source share