RT

解决方案 »

  1.   

    下面是vb.net的代码 C#应该差不多。
    string fileName =FilePath+"CData2.xls"; 
    Excel.XlFileFormat version= Excel.XlFileFormat.xlExcel8;//Excel 2003版本 
    if(System.IO.Path.GetExtension(fileName).ToLower() == ".xlsx") version = Excel.XlFileFormat.xlOpenXMLWorkbook;//Excel 2007版本 xSheet.SaveAs(fileName,version,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value, Missing.Value, Missing.Value, Missing.Value);
      

  2.   

    参考:C# 读写Excel 
    http://blog.csdn.net/loveandhate2008z/archive/2008/11/18/3325301.aspx