I'm trying to use the SpecialCells method in a VSTO project using c# against the 3.5 framework and Excel2007.
Here's my code:
Excel.Worksheet myWs = (Excel.Worksheet)ModelWb.Worksheets[1];
Range myRange = myWs.get_Range("A7", "A800");
//Range rAccounts = myRange.SpecialCells(XlCellType.xlCellTypeConstants, XlSpecialCellsValue.xlTextValues);
Range rAccounts = myWs.Cells.SpecialCells(XlCellType.xlCellTypeConstants, XlSpecialCellsValue.xlTextValues);
When I run this, it throws an exception... System.Exception._COMPlusExceptionCode with a value of -532459699
Note that I get the same exception if I switch(uncomment one and comment the other) the above Range rAccounts line.