//假设是第二列需要加宽。
随便找个第二列的单元格就可以了
Excel.ApplicationClass el = new Excel.ApplicationClass();
object o = Type.Missing;
Excel.Workbook book = el.Workbooks.Open("d:\\aa.xls",o,o,o,o,o,o,o,o,o,o,
o,o,o,o);
Excel.Worksheet sheet = (Excel.Worksheet)book.Worksheets[1];
((Excel.Range)sheet.Cells[1,2]).ColumnWidth = 30;
book.SaveAs("d:\\bb.html",Excel.XlFileFormat.xlHtml,o,o,o,o,Excel.XlSaveAsAccessMode.xlExclusive,o,o,o,o,o);
el.Quit();
|