Insert Cut Cells issue

ExcelTest.zip (81,0 КБ)

Hello,
I have the problem when I try to cut range and then to paste this to the new address. Please see the attached sample - I open the file “sample.xlsx” in my application and then I do the folowing:

var cutRange = workSheet.Cells.CreateRange(“G2:BP25”);
workSheet.Cells.InsertCutCells(cutRange, 1, 0, ShiftType.Right);

Then I save the result to new file (please see attached file named “result.xlsx”). In this file my range is hidden. Please help me to solve my problem. How to perform this operation?

@Mike1987
We can reproduce the issue by testing it on the latest version v24.6 using sample files and the following sample code. Found that the range is hidden when calling Cells.InsertCutCells method.

The sample code as follows:

Workbook wb = new Workbook(filePath + "sample.xlsx");
Worksheet workSheet = wb.Worksheets["test"];

Range cutRange = workSheet.Cells.CreateRange("G2:BP25");
workSheet.Cells.InsertCutCells(cutRange, 1, 0, ShiftType.Right);

wb.Save(filePath + "out_net.xlsx");

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-56008

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.

Thank you. Tell me please, can I use UnhideColumns method calling after InsertCutCells as workaround? May be you can suggest another temporary solution?

@Mike1987
As a temporary solution, you can use the following sample code to achieve the goal. Please refer to the attachment. out_net.zip (40.7 KB)

The sample code as follows:

Workbook wb = new Workbook(filePath + "sample.xlsx");
Worksheet workSheet = wb.Worksheets["test"];

Range cutRange = workSheet.Cells.CreateRange("G2:BP25");
workSheet.Cells.InsertCutCells(cutRange, 1, 0, ShiftType.Right);

workSheet.Cells.UnhideColumns(0, cutRange.ColumnCount, workSheet.Cells.StandardWidthPixels);
wb.Save(filePath + "out_net.xlsx");

Hope helps a bit.

@Mike1987
We are pleased to inform you that your issue (“CELLSNET-55973”) has been resolved. The fix will be included in the next release (Aspose.Cells v24.7). You will be notified when the next version is released.

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