1

I have to generate an excel file and a PDF file from an asp.net application. I'm using the Interop assemblies and I can generate the excel file without any problem. But when I'm generating an pdf file with the add-in SaveAsPDFandXPS.exe I'm getting the next error:

Exception HRESULT: 0x800A03EC

with a debug I see the error is in the next method which is used to export de PDF file:

_objWB.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, _nombreArchivo,
   Excel.XlFixedFormatQuality.xlQualityStandard, false, false, Type.Missing,
   Type.Missing, false, Type.Missing);

3 Answers 3

1

That might happen when the office version that you developed against is different from the one used at runtime.

Sign up to request clarification or add additional context in comments.

Comments

1

You cannot safely use Office Automation in a server process. The Automation APIs are developed for use in a desktop application only. They usually don't work in ASP.NET, or don't work reliably. There are also licensing issues.

Comments

0

Office automation is in general horribly unreliable. Even Microsoft recommend against using it. You might be better off using a pdf generation library like Itextsharp or Crystal Reports.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.