I want to check an excel worksheet if any of the cells have a conditional format that true. I have multiple formats that format cells different colors, but I just want to be able to see if any of the conditions are true (don't care which condition). This example isn't working, but I want to know if I'm on the right track or even possible to do what I'm asking.
var lastCell = Globals.ThisAddIn.Application.ActiveCell.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing);
var firstCell = ((Worksheet)Globals.ThisAddIn.Application.ActiveSheet).Cells[2,1];
var range = ((Worksheet)Globals.ThisAddIn.Application.ActiveSheet).Range[firstCell, lastCell]
var r = range.SpecialCells(XlCellType.xlCellTypeAllFormatConditions, true);