删除线属性

如何删除使用C#在Excel表中删除行?

我试过这个:

{ Excel.Application app = new Excel.Application(); Excel.Workbook workbook = app.Workbooks.Open("D:/Excel.xlsx", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Excel.Worksheet ws = (Excel.Worksheet)app.Sheets["Production_2013"]; Excel.Range range = ws.get_Range("A5", "T10"); string clean_string = CleanStrikethroughChars(range); } string CleanStrikethroughChars(Excel.Range range) { string s = ""; int char_index = 1; int length = range.Cells.Value2.ToString().Length; while (char_index < length) { if ((bool)range.Cells.get_Characters(char_index, 1).Font.Strikethrough) { s += range.Cells.get_Characters(char_index, 1).Text; char_index++; } } return s; 

确定如何使用Excel interop做事情的最好方法之一是在Excel中创build一个预期操作的macros,然后查看生成的VBA代码。 这可能提供了一个关于如何去做需要的暗示。