使用office2003的庫在excel加入條件格式出錯
Excel.Range exr1=obj_sheet.get_Range("C7","C"+iexcelrow.ToString());
exr1.FormatConditions.Add(Excel.XlFormatConditionType.xlCellValue,Excel.XlFormatConditionOperator.xlGreater, "=$O$3",obj_optmissing);
代碼如上
我查過資料都是這麼寫的,在VS中編輯也有自動彈出這個及其說明,但運行竟然報錯:
Method not found: 'Microsoft.Office.Interop.Excel.FormatCondition Microsoft.Office.Interop.Excel.FormatConditions.Add(Microsoft.Office.Interop.Excel.XlFormatConditionType, System.Object, System.Object, System.Object)'.
竟然說找不到這個方法
想了很久找了很多資料,都無解,請高手相助