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 Sep 23, 2024 7:37 pm

We are using Spire.XLS for .NET v13.12.0, with .NET 7.0.
The code is being run in a docker container built from the following image: mcr.microsoft.com/dotnet/sdk:7.0

Whenever we try to calculate a cell in a worksheet with the following formula, nothing happens:

Code: Select all
=IF($L10="","",XLOOKUP(L10,'BSA-21'!$F:$F,'BSA-21'!$G:$G))


We have validated that proper data is in all of the references in the formula and the formula works without issue when we open up the Excel file in a Windows machine and calculate it there. I cannot provide the whole file as it contains sensitive data.

I've also noticed that whenever we try to call `.EnvaluatedValue` on the Cell, it throws the following error:

Code: Select all
Error Message:
   sprば : Invalid formula in Student-count revenues:K9
Error in calculating range K9 in Worksheet Student-count revenues
  Stack Trace:
     at spr☣.攐(Boolean A_0, spr冡 A_1)
   at Spire.Xls.Core.Spreadsheet.XlsRange.get_EnvalutedValue()
   at nextgen_cs.Tests.ProgramTests.OneTimeSchoolLevelAFRTest() in /app/tests/afr-templater.Tests/ProgramTests.cs:line 1479
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)


Are there some Excel formulae that aren't supported by Spire.XLS? I saw that there was this other news article explaining that the XLOOKUP was fixed in v14.5.1 for Java, so I tried upgrading to the latest version but we ran into the same error in .NET.

Here's the code that we run in our test to run into this error

Code: Select all
        [Fact]
        public async void OneTimeSchoolLevelAFRTest()
        {
            // Get the file where we can work with it
            var filepath = "fixtures/test-school-level.xlsm";
            var workbook = new Workbook();
            workbook.LoadFromFile(filepath);
            var worksheet = workbook.Worksheets[WorksheetNames.StudentCountRevenues];

            // Check out differences
            var goodDistrictName = worksheet.Range["K9"];
            var badDistrictName = worksheet.Range["K10"];

            Console.WriteLine($"                     Good | Bad");
            Console.WriteLine("                     ============");
            Console.WriteLine($"Value:              {goodDistrictName.Value} | {badDistrictName.Value}");
            Console.WriteLine($"Value2:             {goodDistrictName.Value2} | {badDistrictName.Value2}");
            Console.WriteLine($"NumberValue:        {goodDistrictName.NumberValue} | {badDistrictName.NumberValue}");
            Console.WriteLine($"NumberText:         {goodDistrictName.NumberText} | {badDistrictName.NumberText}");
            Console.WriteLine($"NumberFormat:       {goodDistrictName.NumberFormat} | {badDistrictName.NumberFormat}");
            // This is the line that throws the error shown above
            Console.WriteLine($"EvaluatedValue:     {goodDistrictName.EnvalutedValue} | {badDistrictName.EnvalutedValue}");
            Console.WriteLine($"BooleanValue:       {goodDistrictName.BooleanValue} | {badDistrictName.BooleanValue}");
            Console.WriteLine($"Formula:            {goodDistrictName.Formula} | {badDistrictName.Formula}");
            Console.WriteLine($"FormulaR1C1:        {goodDistrictName.FormulaR1C1} | {badDistrictName.FormulaR1C1}");
            Console.WriteLine($"FormulaArray:       {goodDistrictName.FormulaArray} | {badDistrictName.FormulaArray}");
            Console.WriteLine($"FormulaArrayR1C1:   {goodDistrictName.FormulaArrayR1C1} | {badDistrictName.FormulaArrayR1C1}");
            Console.WriteLine($"FormulaValue:       {goodDistrictName.FormulaValue} | {badDistrictName.FormulaValue}");
            Console.WriteLine($"FormulaBoolValue:   {goodDistrictName.FormulaBoolValue} | {badDistrictName.FormulaBoolValue}");
            Console.WriteLine($"FormulaErrorValue:  {goodDistrictName.FormulaErrorValue} | {badDistrictName.FormulaErrorValue}");
            Console.WriteLine($"FormulaNumberValue: {goodDistrictName.FormulaNumberValue} | {badDistrictName.FormulaNumberValue}");
            Console.WriteLine($"FormulaStringValue: {goodDistrictName.FormulaStringValue} | {badDistrictName.FormulaStringValue}");
            Console.WriteLine($"DateTimeValue:      {goodDistrictName.DateTimeValue} | {badDistrictName.DateTimeValue}");
            Console.WriteLine($"TimeSpanValue:      {goodDistrictName.TimeSpanValue} | {badDistrictName.TimeSpanValue}");
            Console.WriteLine($"ErrorValue:         {goodDistrictName.ErrorValue} | {badDistrictName.ErrorValue}");
            Console.WriteLine($"Type:               {goodDistrictName.GetType()} | {badDistrictName.GetType()}");
            Console.WriteLine($"IsAllNumber:        {goodDistrictName.IsAllNumber} | {badDistrictName.IsAllNumber}");
            Console.WriteLine($"IsInitialized:      {goodDistrictName.IsInitialized} | {badDistrictName.IsInitialized}");
            Console.WriteLine($"RichText:           {goodDistrictName.RichText} | {badDistrictName.RichText}");
            Console.WriteLine($"Text:               {goodDistrictName.Text} | {badDistrictName.Text}");
        }


Any insight or ideas would be greatly appreciated. Thank you!

alexdisca2
 
Posts: 1
Joined: Mon Sep 23, 2024 7:19 pm

Tue Sep 24, 2024 7:14 am

Hello,

Thanks for your inquiry. I successfully reproduced the problem using the formula you provided. This issue has been logged in our bug tracking system under the number SPIREXLS-5489. Our Dev team will investigate it further, once there is any update, we will let you know.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 283
Joined: Mon Jul 15, 2024 5:40 am

Fri Nov 01, 2024 3:15 am

Hello,

Thank you for your patience.
Glad to inform that we just released Spire.Xls.14.10.2 hotfix which fixes the bug of SPIREXLS-5489, welcome to download it from the following link and test it.
Our website link: https://www.e-iceblue.com/Download/down ... t-now.html
NuGet link: https://www.nuget.org/packages/Spire.XLS/14.10.2

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 283
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.XLS