Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sat Jun 08, 2019 5:01 am

Hello! I had this problem:
I use next code for insert image in my document (.docx)
Code: Select all
Pic = document.Sections[0].Paragraphs[0].AppendPicture(Image.FromFile(@"QR\Essay.jpg"));


It works great, and after i need the generate report in .xls.
For this, I connected the Spire.Xls library (Just connected, no code has not yet written), and this code started to give me the next exceptions:
TypeInitializationException in Spire.Doc.dll

Inner exception:
Could not load type "sprỽ" from "Spire.Pdf, Version=5.2.8.19041, Culture=neutral, PublicKeyToken=663f351905198cb3".


If I rebuild a project several times and start it again, then the exact same exception is already issued in another code:
Code: Select all
  document.LoadFromFile(tempPath);



All file paths are correct, all files open. If I work exclusively with one library (any of them), everything works fine, but as soon as I connect the second to the project, nothing works.

In exception written about "Spire.Pdf", but I do not use Spire.pdf and did not even connect it. What could be the problem? How do I use both libraries (Spire.Doc and Spire.Xls) in the same project?
Thank you in advance

HelloSprite
 
Posts: 3
Joined: Mon Jan 29, 2018 3:22 am

Mon Jun 10, 2019 6:24 am

Hi,

Thanks for your inquiry.
Kindly note that Spire.Doc and Spire.XLS are two independent products. They can't be used in the same project. For your situation. Please download the Spire.Office (at present, the latest version is Spire.Office Platinum (DLL Only) Version:4.6.0) and then reference corresponding dlls (Spire.Doc.dll, Spire.XLS.dll, Spire.Pdf.dll, Spire.Common.dll, Spire.License.dll) from it to your project. If there is any question, just feel free to write back.

Sincerely,
Nancy
E-iceblue support team
User avatar

nancy.yang
 
Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Mon Jun 10, 2019 10:52 am

I understand, thank you!
But after all, dlls in the Spire Office is not the same as in the individual spire doc or spire xls? How did it happen that if you download them separately - they do not work, and if you download the Spire office that contains the same libraries - do they work?

HelloSprite
 
Posts: 3
Joined: Mon Jan 29, 2018 3:22 am

Tue Jun 11, 2019 7:23 am

Hi,

Thanks for your feedback.
The dlls in individual products are not compatible with each other, hence they can't be used together in a same project. However, the dlls in our Spire.Office eliminate the conflicts. Actually, the dlls of our Spire.Office are nearly the same as that of the individual Spire.Doc and Spire.XLS except that the dll version may not be completely consistent. Just rest assured to use our Spire.Office. If there is any question, please feel free to write back.

Sincerely,
Nancy
E-iceblue support team
User avatar

nancy.yang
 
Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Tue Jun 11, 2019 10:49 am

Thank you for you help!
It is clear, now I will use the spire.office. Thank you for your help!

HelloSprite
 
Posts: 3
Joined: Mon Jan 29, 2018 3:22 am

Wed Jun 12, 2019 1:54 am

Hi ,

Thanks for your feedback.
Please feel free to contact us if there is any question.
Have a nice day :)

Sincerely,
Nancy
E-iceblue support team
User avatar

nancy.yang
 
Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Return to Spire.XLS