I'm trying to use: Microsoft.Office.Interop.MSProject
Document Export to export my excel file to PDF as an alternative to Worksheet.ExportAsFixedFormat
which causes some HRESULT problems like:
Exception from HRESULT: 0x800A03EC
I have no idea how to use MSProject
, but here's what I've tried:
- Added the MSProject Reference to my WPF Project: Microsoft.Office.Interop.MSProject (Version 15.0.0.0)
Replaced my
Worksheet.ExportAsFixedFormat
code with:Microsoft.Office.Interop.MSProject.Application mainMSProjectApplication = new Microsoft.Office.Interop.MSProject.Application(); mainMSProjectApplication.DocumentExport(path, Microsoft.Office.Interop.MSProject.PjDocExportType.pjPDF, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
I get an exception on the first line:
Retrieving the COM class factory for component with CLSID {36D27C48-A1E8-11D3-BA55-00C04F72F325} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
- Then I tried: Windows Key > "Run": regsvr32 "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.MSProject.dll"
I then get this Error:
The module "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.MSProject.dll" was loaded but the entry-point DllRegisterServer was not found.
Any help would be appreciated