往excel 2000中写入内容代码如下:
private void button2_Click(object sender, System.EventArgs e)
{

MessageBox.Show("goodd");
Excel.Application excel ;
excel = new Excel.ApplicationClass();
Excel.WorkbookClass oWB;
Excel.Worksheet oSheet;
oWB = (Excel.WorkbookClass)(excel.Workbooks.Add(true));
oSheet = (Excel.Worksheet)oWB.ActiveSheet;
oWB.Close(false,"ok",null);  
excel.Workbooks.Close();   
excel.Quit();  
System.Runtime.InteropServices.Marshal.ReleaseComObject (excel);
System.Runtime.InteropServices.Marshal.ReleaseComObject (oWB);
System.Runtime.InteropServices.Marshal.ReleaseComObject (oSheet);
oSheet = null;
oWB= null;
excel = null;
}
运行时出错,提示为:
未处理的“System.TypeLoadException”类型的异常出现在 system.windows.forms.dll 中。
其他信息: 未能从程序集 excel, Version=1.0.366.73, Culture=neutral, PublicKeyToken=null 中加载类型 Excel.ApplicationClass。
我已经用TlbImp Excel9.olb了,而且在引用中增加了对excel.dll的引用了,请请教!