Inserting columns corrupts workbook

When inserting a column, the resulting workbook is corrupt after trying to open in excel.

The attached workbooks and code snippet can be used to recreate the issue

            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(Path.Combine(path, "test_aspose_insert_column_bug_input.xlsx"));
            wb.Worksheets[0].Cells.InsertColumns(9, 1, true);
            wb.Save(Path.Combine(path, "test_aspose_insert_column_bug_output.xlsx"));

test_aspose_insert_column_bug_output.zip (413.7 KB)

I have a handful of other workbooks which experience the same/similar issues (all when inserting columns in the same manner)

If there’s a workaround or formula structure to avoid to not corrupt workbooks, that would be awesome to know so we can implement a quick fix for this.

@ipaul10,
I have tried this scenario using the latest version Aspose.Cells for .NET 20.11 but could not observe any issue. The output file opens fine in MS Excel. Could you please test the scenario with the latest version and if issue is still there, share your environments details with us. We will reproduce the scenario here and share our feedback accordingly.

@ahsaniqbalsidiqui,
Sorry about that, you’re right that Aspose.Cells for .NET 20.11 fixed the issue I was having for this workbook (I was originally using 20.10).

However, it seems like the issue is still persisting for 20.11 for the attached workbooks and using the following code snippet

            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(Path.Combine(path, "test_aspose_insert_column_bug_input_newcrest.xlsx"));
            wb.Worksheets[0].Cells.InsertColumns(25, 1, true);
            wb.Save(Path.Combine(path, "test_aspose_insert_column_bug_output_newcrest.xlsx"));

test_aspose_insert_column_bug_newcrest.zip (412.3 KB)

@ipaul10,
I have tried your latest sample file with the latest hotfix but could not observe any issue. Please give it a try and share the feedback.

test_aspose_insert_column_bug_input_newcrest_20.11.9.xlsx.zip (197.3 KB)
Aspose.Cells20.11.9 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.11.9 For .NetStandard20.Zip (5.4 MB)

@ahsaniqbalsidiqui

Thanks for sharing those packages. I can confirm the new hotfix resolves the problematic workbooks.

Do you know when this will be shipped out as a ready-to-use version of Aspose.Cells? Unfortunately we’re a bit reliant on using the Aspose.Cells nuget package in production.

@ahsaniqbalsidiqui

One thing to note is that I think Aspose.Cells.Workbook.FileName is a bit different than before in 20.11.9. I’m not sure if that’s an intended change but something worth noting.

@ipaul10,
Aspose.Cells 20.12 will be released via NuGet package manager in a couple of days. Regarding the FileName difference please share the details with us. We will analyze the information and share our feedback accordingly.

Thank you for this update!

And my apologies, it appears that the Aspose.Cells.Workbook.FileName property is working as expected. Please disregard.

@ipaul10,

No worries and good to know that your issue is sorted out now.