We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with used range after deleting a column

hi, we have been experiencing a problem with certain excel template files. for the attached example, the original template has a used range which ends at column P, after removing the first column programmatically and opening the resulting file with excel 2007 or 2010 it appears to have a used range that extends to column XFC. it appears that copy and pasting all cells on the template from the problematic sheet to a new sheet and saving it with the same name fixes the problem, but this issue has shown up on many of our templates and sometimes reoccurs after it has been copy/pasted/saved. the .Cells.MaxColumn and .Cells.MaxDataColumn seem to show the correct values, is there any other way to set excel’s UsedRange? can you tell what specifically about the sheet causes the issue?


thanks



The only lines of code used to demonstrate the problem are:

Workbook currentWorkbook = new Workbook(“problem_template.xlsx”);
currentWorkbook.Worksheets[0].Cells.DeleteColumn(0);
currentWorkbook.Save(“result.xlsx”)

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v7.1.0.5

I tested your scenario a bit with the sample code below and it looks to me fine.

Workbook currentWorkbook = new Workbook(“e:\test2\problem_template.xlsx”);

currentWorkbook.Worksheets[0].Cells.DeleteColumn(0);

currentWorkbook.Save(“e:\test2\outnew.xlsx”);


Please also find attached the output file here.

Thank you.

the output you included shows the problem when i open it with excel 2010 on my windows 7 x64 machine. the position marker on the horizontal scroll bar displays very small and when you push Ctrl+End (go to the last cell in excel’s UsedRange) it goes to cell XFC4. if you run the same code on the attached fixed_template.xlsx you should see the expected result (the horizontal scroll bar is the same size as it appears in the template and Ctrl+End goes to O3)


thanks

Hi,


Yes, I can find the issue as you have pointed out. I have logged a ticket with an id: CELLSNET-40364. We will look into it to figure it out soon.

Thank you.


Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.1.0.6