Aspose.Cells.CellsException: Invalid cell name: System.Char[] - More Details?

Hello,

I have a presentation in our production environment where a routine is throwing an error from Aspose.Cells. The exception is the Aspose.Cells.CellsException. The message reads exclusively:

Invalid cell name: System.Char[]

Unfortunately, I am having a very hard time understanding what this means or where I even start trying to figure out how this works.

For reference, the file in question is this:

save.zip (2.5 MB)

my C# environment has this installed via NuGet:

    <PackageReference Include="Aspose.Cells" Version="24.9.0" />
    <PackageReference Include="Aspose.Slides.NET" Version="24.9.0" />
    <PackageReference Include="DocumentFormat.OpenXml" Version="3.1.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

The exception is thrown at the line:

using Workbook wb = new(ms);

Here is the C# code used to create this error:

code.zip (464 Bytes)

If I try to do things with say this, very similar Presentation with Excel embedded objects, it works fine and dandy.

it.will.refresh.zip (2.6 MB)

What I want to know is if this exception has any other additional information I can go off of to understand why this is being thrown in this case. Every other lead I have had has hit a dead end.

@BK.Broiler.730
We have tested your code with the file “it.will.refresh.pptx” but cannot find any issue. The workbook can be instantiated successfully. Would you please provide us your sample project to reproduce the issue? Or, you may just separate the test into two steps and then test the issue separately. First is saving the xlsx file data got from slides to a local file. Second is loading the workbook from the saved xlsx file in another project without other references. We think in this way it should be clear and easy to find what caused the issue.

The issue cannot be replicated with the “it.will.refresh.pptx” I provided that as an example of the code working. The “save.pptx” file should have the same exact workbook structure as “it.will.refresh” but the error is happening there.

@BK.Broiler.730
By testing with sample code and files on the latest version v24.9, we can reproduce the issue. Found that invalid cell name exception occurred when parsing OleObject.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-56784

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@BK.Broiler.730
Which tool created this embedded xlsx file?
Please try the following codes to directly exporting data to xlsx file:

        Aspose.Slides.Presentation OriginalPresentation = new Aspose.Slides.Presentation(ReportStream);

            foreach (Aspose.Slides.ISlide slide in OriginalPresentation.Slides)
            {
                foreach (Aspose.Slides.IShape shape in slide.Shapes)
                {
                    if (shape is Aspose.Slides.OleObjectFrame ole)
                    {
                        string partId = $"{slide.SlideId}_{ole.Name.ToUpper()}";
                        if (partId == "260_OBJECT 8")
                        {
                            Console.WriteLine(ole.EmbeddedFileName);
                            MemoryStream ms = new MemoryStream(ole.EmbeddedData.EmbeddedFileData);
                            File.WriteAllBytes(@"D:\filetemp\dest.xlsx", ole.EmbeddedData.EmbeddedFileData);
                           // Workbook wb = new Workbook(ms);
                        }
                    }
                }
            }

You will find the file is corrupted.

The file was created with a proprietary plugin, at first it works fine but after the underlying data updates, it becomes in accessible. I am trying to find out where exactly problems are and trying to open the file using the Aspose library does not provide additional information.

@BK.Broiler.730,

We have recorded the details you provided in the ticket and will thoroughly investigate your issue. We will get back to you soon.

@BK.Broiler.730
In the file which caused corrupted message for ms excel and exception for Aspose.Cells, the saved order of cells is messed up. For example, in the forth sheet, cell AU2 is placed after CR2. Such kind of data caused issue for both ms excel and our component. We will try to handle such situation in our later versions by ignoring those cells with incorrect order, or filling data to corresponding cells according to their address.

hey, thanks, I am still trying to understand why the excel is corrupted after updating the ‘data’ tab, but this excel sheet is pretty insane as it is, too many moving parts. I appreciate the response and attentiveness.

@BK.Broiler.730,

As we told you, some cells in the specified worksheets were displaced (not placed in correct order) and corrupted the file. For example, in the forth sheet, cell AU2 was placed after CR2. Such kind of data caused issue for both MS Excel and Aspose.Cells. On Aspose.Cells’ part, we will try to handle such situation in future versions by skipping or ignoring such cells (with incorrect order).

@BK.Broiler.730

For example, in template file the correct data should be saved as A1, B1,C1…A2,B2,C2…; If those cells were saved in disorder such as A1,C1,B1,…, then the corresponding xlsx file will cause issue for both MS Excel and our component.

The issues you have found earlier (filed as CELLSNET-56784) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi