有如下代码Excel.Range rangeFormat= null ;
range = sheet.get_Range(sheet.Cells[1,1],sheet.Cells[100,100]);
rangeFormat.Font.Size = 10;
rangeFormat.Font.Bold = true;
rangeFormat.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
rangeFormat.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
rangeFormat.Interior.ColorIndex = bkColorBlue;
rangeFormat.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlThin, Excel.XlColorIndex.xlColorIndexAutomatic, missValue);
rangeFormat.EntireColumn.AutoFit();为什么字体,对齐等格式,都是整个范围内的所有单元格有效,而边框画线(BorderAround)却仅仅是最外层的区域有效,区域内的单元格都没有画上边框。