从DataGridView导出Excel的两种情况,不多说,直接记录代码(新建类,直接引用传入参数). using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Data; namespace cnblogs { public static class LoadExce
using Microsoft.Office.Interop.Excel; using Excel=Microsoft.Office.Interop.Excel; //这里Excel和Interop报错,请参考我的另一篇http://blog.csdn.net/xtfnpgy/article/details/41076849 public bool ExportDataGridview(DataGridView gridView,string str_path) {