Is there a way to get Worksheet from the Cell in Aspose Cells?

1.2k Views Asked by At

I'm looking for something like myCell.Parent or myCell.Worksheet to get the Worksheet object of a Cell in Aspose cells for .net. I didn't see any property on the Cell class that refers the Worksheet. Wondering if there is a way that I missed?

3

There are 3 best solutions below

0
On BEST ANSWER

I've also asked in the Aspose Forum. It's not possible yet, but the added my request as new feature request.

1
On

Convert or cast cell to Range and then you can find the Worksheet property:

Excel.Range myRange = (Excel.Range) myCell;
Excel.WorkSheet myWS = null;
if ( myCell != null ) {
   myWS = myRange.WorkSheet;
}
0
On

Using the latest versions of Aspose.Cells for .NET (e.g Aspose.Cells for .NET v5.3.2 etc.) now, it is possible to get the parent worksheet from the cell object. You may simply use Cell.Worksheet property.