Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I get only visible cells using range.get_Value?
Hi All!
Ive a code on C# that reads the data from Excels spreadsheet. I use Excel.Worksheet.get_Range method to get a Excel.Range object like this: Excel.Range range = Worksheet.get_Range("A1", Missing.Value); After I got the range I read the data into a multi-dimensional array as following: Object[,] saRet; saRet = (System.Object[,])range.get_Value(Missing.Value); Everything works fine until I want to get only visible cells from the spreadsheet. So I use the code: range = range.SpecialCells(xlCellTypeVisible, Missing.Value); When I try to invoke the range.get_Value(Missing.Value) method I got an exception that states it cannot cast a string to Object[,]. So, Im confused about what SpecialCells(xlCellTypeVisible) returns. Could anyone provide me a hint how to get only visible range from the spreadsheet? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set Range of Visible Cells | Excel Programming | |||
Selecting an offset of a range of visible cells, but only those <0? | Excel Programming | |||
How do I include only visible cells in a range? | Excel Worksheet Functions | |||
Sum only visible cells within a range. | Excel Programming | |||
Trying to select the visible range of cells | Excel Programming |