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

Free Support Forum - aspose.com

How to check if a cell is hidden in .NET

Hi,

when open a excel file,How to identify the Excel file whether have the cell is hidden?

best regard!

Eric


Hi,

Thanks for your good question and considering Aspose.Cells.

Cell is hidden when either its row is hidden or its column is hidden or both row and column is hidden.

Please see the following code and its comments for your reference

C#

string filePath = @“F:\Shak-Data-RW\Downloads\sample.xlsx”;

Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.Worksheets[0];

//Sample cell
Cell cell = worksheet.Cells[“C14”];

//Check if the cell is Hidden via its Row
bool isRowHidden = worksheet.Cells.Rows[cell.Row].IsHidden;

//Check if the cell is Hidden via its Column
bool isColumnHidden = worksheet.Cells.Columns[cell.Column].IsHidden;

//If either Row or Column is hidden then the cell is also hidden.