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

Free Support Forum - aspose.com

Range.MoveTo

When I have a range that I create using Cells.CreateRange (firstRow,FirstColumn,lastRow,ColumnCount)

And then call range.MoveTo(row,column)

I am getting an Object Instance Is not set to an instance of an object.

I did not get this in previous versions of Aspose.Cells. I am using Aspose.Cells 8.7

Hi Steve,


Thank you for contacting Aspose support.

I have evaluated your presented scenario while using the code snippet provided at the bottom of this post against the latest revision of Aspose.Cells for .NET 8.7.1.4 and a sample of my own. However, I am not able to observe any exception during the process. In fact, the range has moved correctly (please check attached spreadsheets). Please give a try to the latest revision of the API on your side as well. In case the problem persists, please provide us an executable sample application along with the input & output spreadsheets, if any. Please also share your environment details such as operating system’s version & architecture, locale of your machine, target .NET Framework and so on. Please also state which version of the Aspose.Cells for .NET API works fine for this scenario.

C#

Workbook book = new Workbook(dir + “Book1.xlsx”);

Worksheet sheet = book.Worksheets[0];
Range range = sheet.Cells.CreateRange(0, 0, 1, 1);
range.MoveTo(3, 3);
book.Save(dir + “output.xlsx”);