//这里加添加一个excel对象的包装器.就是添加一个引用
using system.drawing; 【程序编程相关:为DataGrid 写一个 DropDo】using system; 【推荐阅读:XML文件显示、修改、查找】
using system.componentmodel; 【扩展信息:SQLServer与JAVA字符集转化】using system.collections;using system.windows.forms;namespace exceltest
{ /// <summary> /// form3 的摘要说明. /// </summary> public class form3 : system.windows.forms.form { private system.windows.forms.button button1; private system.windows.forms.combobox combobox1; /// <summary> /// 必需的设计器变量. /// </summary> private system.componentmodel.container components = null; // excel object references. private excel.application m_objexcel = null; private excel.workbooks m_objbooks = null; private excel._workbook m_objbook = null; private excel.sheets m_objsheets = null; private excel._worksheet m_objsheet = null; private excel.range m_objrange = null; private excel.font m_objfont = null; private excel.querytables m_objqrytables = null; private excel._querytable m_objqrytable = null;// frequenty-used variable for optional arguments.
private object m_objopt = system.reflection.missing.value;// paths used by the sample code for accessing and storing data.
private string m_strnorthwind = @"c:\program files\microsoft visual studio\vb98\nwind.mdb";public form3()
{ // // windows 窗体设计器支持所必需的 // initializecomponent();//
// todo: 在 initializecomponent 调用后添加任何构造函数代码 // }/// <summary>
/// 清理所有正在使用的资源. /// </summary> protected override void dispose( bool disposing ) { if( disposing ) { if(components != null) { components.dispose(); } } base.dispose( disposing ); }#region windows 窗体设计器生成的代码
/// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容.... 下一页