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.

Thu Sep 20, 2018 7:05 am

Dear support:

I'm trying to convert a Excel chart to image with the following codes.
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromFile("test.xlsx");
Worksheet sheet = workbook.Worksheets[0];
if (sheet.Charts.Count > 0)
{
    Image[] imgs = workbook.SaveChartAsImage(sheet);
}

It throw a NullReferenceException on this line: Image[] imgs = workbook.SaveChartAsImage(sheet),but sheet and workbook are not null.
please help,thank you.

demonica
 
Posts: 1
Joined: Thu Sep 20, 2018 6:47 am

Thu Sep 20, 2018 7:32 am

Hello,

Thanks for your inquiry.
If you were using an old version, I suggest that you upgrade to the latest commercial version (Spire.XLS Pack(Hotfix) Version:8.9.3) to have a test. If the issue still troubles you, please provide your Excel file so that we can do further investigations. You could send it to our email (support@e-iceblue.com).

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Wed Sep 26, 2018 7:32 am

Hello,

Greetings from E-iceblue.
How is your issue going?
Any feedback will be greatly appreciated.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS