using System; using System
Collections
Generic; using System
ComponentModel; using System
Data; using System
Drawing; using System
Text; using System
Windows
Forms; using System
Reflection; using System
IO; namespace ExcelTest { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } string[] ExcelColumTitle ={ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; int[] ExcelColumWidth ={10,15,15,12,12,12,20 };//各列宽度 private void btnOk_Click(object sender, EventArgs e) { this
Enabled = false; Excel
Application excelKccx = new Excel
Application();//创建excel 对象 excelKccx
Workbooks
Add(true);//创建excel 工作薄 int row = 2; //把数据表的各个信息输入到 excel 表中 for (int i = 0; i < dataGridView1
Columns
Count; i