Converting Excel to PDF

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v1)  /  Converting Excel to PDF

DynamicPDF Converter for .NET (v1) Forum

 Aug 12 2011 5:23 AM
Hi,

I am tryign to convert xls/xlsx files to PDF. The Excel sheets are very basic sheets. I receive the following error;


Exception:

System.Exception: System.Exception: Conversion failed ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Open method of Workbooks class failed

   --- End of inner exception stack trace ---
   at bc.b(ac A_0, ac A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at ceTe.DynamicPDF.Conversion.Program.a.b()
   at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0)
   at ceTe.DynamicPDF.Conversion.Program.a(Object A_0) ---> System.Exception: System.Exception: Conversion failed ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Open method of Workbooks class failed

   --- End of inner exception stack trace ---
   at bc.b(ac A_0, ac A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at ceTe.DynamicPDF.Conversion.Program.a.b()
   at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0)
   at ceTe.DynamicPDF.Conversion.Program.a(Object A_0)
   at h.a(Object A_0)
   --- End of inner exception stack trace ---

Can anyone help?

Thanks,
George
 Aug 12 2011 6:44 AM
Posted by a ceTe Software moderator
Hello George,

Please send over the below information to our support team at: support@cete.com so that they can do some testing and look into it further.

1.A copy of the file(s) that are causing this error.
2.Version of MS Office installed on the computer.
3.Name and Version of OS.
4.32-bit or 64-bit OS?
5.Regional settings of the computer if other than English. 

Thanks,
ceTe Software Support Team.
 Jan 07 2014 11:39 PM
I am also getting same error
OS - 64 bit
 Jan 08 2014 12:21 AM
When using overload of convert method
ceTe.DynamicPDF.Conversion.Converter.Convert(bytearray, "Book1.xlsx", "C:\Users\u6ic_re\Desktop\Book2.pdf", options1)

Same error.

System.Exception: Conversion failed ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Open method of Workbooks class failed

   --- End of inner exception stack trace ---
   at p.b(i A_0, i A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at ceTe.DynamicPDF.Conversion.Program.a.b()
   at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0)

OS 64 bit.
Excel 2007
   at ceTe.DynamicPDF.Conversion.Program.a(Object A_0)

 Jan 08 2014 9:18 AM
Posted by a ceTe Software moderator
Hello,

Please try using the latest DynamicPDF Converter for .NET product files in your system and see if it works for you. You can download the latest product MSI by logging into our CustomerArea using your DynamicPDF product serial number. Uninstall the older product and install the very latest using the correct product MSI.

If you are evaluating the product then you can download the latest DynamicPDF Converter for .NET product from our website here.

If you continue getting the error then please send over the following details to our support team so that they can look into it further.

1.Input Excel file.
2.Exact build number of the DynamicPDF Converter product. You can get this information from the MSI file name which you used to install the product.
3.Name of the operating system.

Thanks,
ceTe Software Support Team.
 Aug 17 2016 8:42 AM
In 2016, this is still a bug.

It's officially recognised by Microsoft as a bug, here: https://support.microsoft.com/en-us/kb/320369

The suggested workaround is too painful and I am not even sure if it works in the latest versions of .NET. There's an easier way to fix it, when you know the root cause.

Here we go. In my case, I have my Windows development machine with Dutch locale settings, but my Microsoft Office 2010 x86 version is en-US. As explained in the hyperlink above, Excel doesn't handle that correctly.

The solution I found was to download and install "Office 2010 Language Pack (x86) - (Dutch)". It worked directly after installing, no reboot was required.
 Aug 17 2016 2:33 PM
Posted by a ceTe Software moderator
Hello,

Thanks for posting the workaround. The MS bug info you posted is referring to the following exception “Old format or invalid type library” whereas the issue discussed in the above posts has a different exception “Open method of Workbooks class failed”. 

We have already addressed the issue that caused the “Open method of Workbooks class failed” exception in our product. The latest build available on the product download page and in the customer area includes the fix.  If you are still seeing the exception (Open method of Workbooks class failed) with the latest build, pelase email the excel file and the OS details to our support team at support@cete.com


Thanks,
ceTe Software Support Team.
 Aug 24 2016 11:00 AM
You are correct, the exception is slightly different.

The problem is still valid, just the scenario is different. I just thought of posting it to help others that may be facing the same issue.

I am not having the problem anymore after installing the language pack.

All times are US Eastern Standard time. The time now is 12:58 AM.