试试这段代码
private void button2_Click(object sender, System.EventArgs e)//导出按钮
{
Excel.Application myExcel = new Excel .Application();
myExcel.Application .Workbooks .Add (true);
myExcel.Visible = true;
myExcel.Cells [1,4]="普通0";
// for(int i =0;i<"Sheet1$".Rows .Count ;i++)
for(int i=0;i<n;i++)
{
for(int j=1;j<m;j++)
{
myExcel.Cells [2+i,j]= this.dataGrid1[i,j].ToString ();
}
}
}