///
///
public static void ExportToExcel(string filePath, DataSet ds) { object oMissing = System.Reflection.Missing.Value; Excel.ApplicationClass xlApp = new Excel.ApplicationClass(); try { // 打开Excel文件。以下为Office 2000. Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(filePath, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing); Excel.Worksheet xlWorksheet; // 循环所有DataTable for( int i=0; i