Cannot convert .XLSX files to pdf using PDFNet SDK. Error getting Workbook.ExportAsFixedFormat ID


Good day,

We are getting the following error on all conversions from Excel to PDF using Office Interop.

  • We are using interop only. We tried printer option but we are getting formatting issues (Excel cells are broken, moving to next page, etc.)
  • Desktop folder exists in systemprofile for correct version of Office on Windows
  • We are using licensed Office 365
  • Spooler is already enabled
  • Word and Powerpoint conversion are working fine

Error getting Workbook.ExportAsFixedFormat ID.
Code: PDFTRON_UNKNOWN (-2147024891)
File: “Excel.cpp”:201
Start check system account.
Session ID is: 0.
Done checking system account.
Creating an Excel application instance.
Excel application instance created.
Application.AutomationSecurity ID obtained.
Application.AutomationSecurity value set to 3.
Application.DisplayAlerts ID obtained.
Application.Version ID obtained.
Application version: 16.
Application.Build ID obtained.
Application build: 0.
Application.Workbooks ID obtained.
Opening workbook “C:\services\conversionService\service\Temp\Input\1c3ede8525d54ba88ac966ed2076d15c.xlsx”.
Workbooks.Open ID obtained.
Workbook “C:\services\conversionService\service\Temp\Input\1c3ede8525d54ba88ac966ed2076d15c.xlsx” opened.
Workbook.Saved ID obtained.
Error setting Workbook.Saved value.

Conditional expression: false
Version :
Filename : Convert.cpp
Function : trn::PDF::Convert::ToPdf
Linenumber : 1777
pdftron.Common.PDFNetException: Exception:
Message: An error occurred while converting the file.
Detailed error:
Message: Error getting Workbook.ExportAsFixedFormat ID.

Thank you for the very detailed ticket.

Can you please try using our latest SDK. At the very least that might provide additional debug info.