ExportExcel
本文链接:http://user.qzone.qq.com/108633744/blog/1219742370
{ //Excel导出 if (dgv.RowCount == 0) { MessageBox.Show("没有数据要导出", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Excel.ApplicationClass appExcel; Excel.Range selectRange; try { appExcel = new Excel.ApplicationClass(); appExcel.Workbooks.Add(true); appExcel.Visible = true; } catch { |