How can I convert Excel documents (files) to PDF in an automated fashion? I am trying to adapt the solution found here to Excel. So far I have this:
var fso
You're clobbering objExcel on line 15:
var objExcel = objExcel.Workbooks.Open(docPath);
Those lines of code need to use a different variable, e.g.:
var objWorkbook = objExcel.Workbooks.Open(docPath); var wdFormatPdf = 57; objWorkbook.SaveAs(pdfPath, wdFormatPdf); objWorkbook.Close();