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.

Mon Jun 05, 2023 5:56 am

Hey,

I am using your free Spire.XLS

And I'm getting an exception.

An unhandled exception of type 'System.NullReferenceException' occurred in Spire.XLS.dll
Additional information: Object reference not set to an instance of an object.


Here is my code:
Workbook workbook = new Workbook();
//Load an Excel sample document
workbook.LoadFromFile(result);

//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];

//Create an HTMLOptions instance
Spire.Xls.Core.Spreadsheet.HTMLOptions options = new Spire.Xls.Core.Spreadsheet.HTMLOptions();

//Embed images to HTML
options.ImageEmbedded = true;

sheet.SaveToHtml("myL.html");


Please help me how to resolve this.

Thanks

vikasekam
 
Posts: 4
Joined: Sun Jun 04, 2023 2:28 pm

Mon Jun 05, 2023 7:28 am

Hello,

Thanks for your inquiry.
I simulated an Excel file and did an initial test, but did not reproduce your issue. We suggest that you use the latest version of FreeSpire.XLS( Version:12.7.0) or Spire.XLS(Spire.XLS Pack(Hotfix) Version:13.5.6) for testing first. If the issue still exists after testing, in order to help us investigate your issue quickly and effectively, please provide the following information for our reference. You could send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your sample Excel file .
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app (. Net Framework 4.5).

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Tue Jun 06, 2023 2:26 pm

Windows 11 64bit
Region English(India)
Windows Form Application Framework 4.5.2


You can use any Excel file.
Attachments
Form1.rar
(747 Bytes) Downloaded 377 times

vikasekam
 
Posts: 4
Joined: Sun Jun 04, 2023 2:28 pm

Tue Jun 06, 2023 2:29 pm

Please find the screenshot
Attachments
Test.rar
(310.31 KiB) Downloaded 378 times

vikasekam
 
Posts: 4
Joined: Sun Jun 04, 2023 2:28 pm

Wed Jun 07, 2023 8:22 am

Hello,

Thank you for your feedback.
According to the information you provided, we have conducted multiple tests, but we could not reproduce the issue you mentioned. Here is our test project (including our test Excel file and corresponding result file). Please download and test it, and let us know your test results.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Wed Jun 07, 2023 8:52 am

Please advise me, What should I do, I have tested this code on multiple frameworks.

Even your supplied code is not working. It's showing the same exception.



Thanks

vikasekam
 
Posts: 4
Joined: Sun Jun 04, 2023 2:28 pm

Wed Jun 07, 2023 9:57 am

Hi,

Thank you for your response.
Please package the entire project(including your source Excel file is better) that can reproduce your issue and send it to us via email(support@e-iceblue.com).

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.XLS

cron