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 Feb 24, 2014 8:38 pm

I am trying to evaluate whether Spire.XLS is going to meet our requirements. Firstly, it handles calculations of formulas so it is already ahead of the competition that I have evaluated. However, I am coming across a very frustrating issue that I need to resolve.

I have a spreadsheet with lots of formulas and named ranges, at least 5 sheets of formulas. When I execute Workbook.CalculateAllValue() my code waits for a little while (so it is calculating formulas) and then throws an exception with the following message:

Key cannot be null. Parameter name: key

But it doesn't tell me where this problem occurs so I have no idea what formula is causing the problem if ant, the workbook is calculated correctly by Excel and the formula validation in Excel shows no formula with an error.

Any ideas how I can track down at what stage CalculateAllValue() is failing. Also, once it fails the calculation engine appears to be permanently broken as it will no longer calculate any formula values.

chenderson
 
Posts: 1
Joined: Tue Feb 18, 2014 11:50 pm

Tue Feb 25, 2014 2:59 am

Hello,

Thanks for your considering our product.
To help us to reproduce qucikly and resolve the issue, would you please provide us your excel if could?
You also could send your file to support@e-iceblue.com.
We promise to keep your document confidential and we will not use it for any other purpose. Besides, you could also remove the security data of your document and then send it to us.

Many thanks.

Best wishes and have a nice day,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Fri Oct 07, 2016 6:13 pm

I am receiving the same "Index was out of range" error when I added the workbook.CalculateAllValue(); line to a very simple sample MVC controller action. It pushes values into a template XLSX file with three value cells set in code (B1-B3) and B4 in the template file has a =SUM(B1:B3) formula. Please advise. Thanks.

Using Spire.Office 2.14.7
MVC 5
target Framework net452

Code: Select all
        public void _ExportXLSXFromTemplate()
        {
            //Creates workbook
            Workbook workbook = new Workbook();

            //Get template file from an app directory
            string path = Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "Content/", "ExcelTemplate.xlsx" );
            workbook.LoadFromFile( path );

            Worksheet workSheet = workbook.Worksheets[0];
            workSheet.Range["B1"].Value = "10";
            workSheet.Range["B2"].Value = "45";
            workSheet.Range["B3"].Value = "60";

            workbook.CalculateAllValue();

            Response.Clear();
            Response.ContentType = "application/xlsx";
            Response.AddHeader( "Content-Disposition", "attachment;filename=" + "GeneratedExcelFromTemplate.xlsx" );

            workbook.SaveToStream( Response.OutputStream, Spire.Xls.FileFormat.Version2013 );
        }
Attachments
ExcelTemplate.zip
(5.92 KiB) Downloaded 288 times

CRWebmaster
 
Posts: 2
Joined: Wed Feb 04, 2015 5:58 pm

Sat Oct 08, 2016 8:29 am

Dear chenderson,

Thanks for your feedback. I have noticed the issue and posted your issue to our Dev Team. Once it is fixed,we will inform you ASAP.
As an temporary solution, you can try to use another method.
Code: Select all
 
workbook.SaveToStream(Response.OutputStream)


Sincerely,
Nina
E-iceblue support team
User avatar

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

Fri Nov 11, 2016 8:26 am

Hi,

Thanks for your waiting.
Now the version of Spire.Office(Spire.Office Platinum Version:2.15) has been released, which resolves your issue. Please download it and have a try.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Fri Nov 18, 2016 8:26 am

Hello,

Have you tested the new version? How is your issue now? Could you please give us some feedback at your convenience?

Thanks,
Nina
E-iceblue support team
User avatar

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

Fri Dec 09, 2016 7:22 pm

We have confirmed in our code that the recent release corrected the problem we identified on 10/7/2016 where the follow line received errors:
Code: Select all
workbook.SaveToStream( Response.OutputStream, Spire.Xls.FileFormat.Version2013 );


We can now successfully generate a workbook using this line of code (as well as calling it without a file format as you suggested). Thanks for the fast turn-around on this.

CRWebmaster
 
Posts: 2
Joined: Wed Feb 04, 2015 5:58 pm

Mon Dec 12, 2016 2:48 am

Dear CRWebmaster,

Thanks for your feedback.
Please feel free to contact us if you have any futher questions. We're here for help you.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Return to Spire.XLS