Determining if a row or column is hidden

I hope this is an easy answer for someone with a little more experience out there!

I am attempting to detrmine if a row or a column I have read in from an Excel document is hidden or not. The Cells object has the ability to hide or unhide columns and rows, but I can not find a “hidden” property.

Can anyone provide some sage-like advice?

-Dave

Please try the attached fix with the following code:

for(int i = 0; i < 10; i ++)
{
double height = cells.GetRowHeight(i);
if(height == 0.0)
{
//row is hidden. processing it here

}
}

for(int i = 0; i < 10; i ++)
{
double width = cells.GetColumnWidth(i);
if(width == 0.0)
{
//column is hidden. processing it here

}
}

Thank you for the response! Yes, I did try viewing the height, but the height of the hidden row or column as set to its “unhidden” value, even if it was hidden. Did you find this to be true as well?

I noticed you attached a dll to your response that was newer than the one I had (downloaded 8/20/2005). When I used the new dll, I was able to see that both hidden rows and columns had a size of 0.0. Thanks again for your help!
-Dave

@angrydavie,
We have discontinued Aspose.Excel and introduced a new product Aspose.Cells that is a much advanced and feature-rich product. It contains a lot of functions that can be used to check the look and feel of the Excel file. Now you can set/un-set and check the visibility of a column or row as demonstrated in the following sample code.

Workbook workbook = new Workbook();
workbook.Worksheets[0].Cells.HideColumn(2);
Console.WriteLine(workbook.Worksheets[0].Cells.IsColumnHidden(2));

workbook.Worksheets[0].Cells.HideColumns(4, 4);
for(int c = 4; c< 8;c++)
    Console.WriteLine(workbook.Worksheets[0].Cells.IsColumnHidden(c));

//A random check. It should display FALSE
Console.WriteLine(workbook.Worksheets[0].Cells.IsColumnHidden(10));

Here we can see that Cells class contains functions HideColumn(), HideColumns() and IsColumnHidden(). You can hide a single column using the HideColumn() by providing (0 index based) column number as argument.

Similarly if multiple columns are to be hidden, use HideColumns(), where the first argument is the starting column number and the second argument is the number of columns to be hidden.

You can use IsColumnHidden() function to check if a column is hidden or not.

The same set of functions is available for rows like HideRow, HideRows, and IsRowHidden.

Test the product features by downloading a free trial version here:
Aspose.Cells for .NET (Latest Version)

A comprehensive solution is available here that can be used to test different features of this product.