??

解决方案 »

  1.   

    不是很明白你说什么,操作excel没有什么控件啊http://www.i2key.com/TechDoc/Index.aspx?grads=0&Curpage=1&SearchKey=excel&CatID=
      

  2.   

    ExcelFile ef = new ExcelFile();
    中的ExcelFile,在那个地方!!需要com控件吗!!,如果要,,这个控件的名称???
      

  3.   

    Excel.Application app=new Excel.ApplicationClass();
    if (app == null) 
    {
    statusBar1.Text = "ERROR: EXCEL couldn't be started!";
    return ;
    }
    app.Visible = true; //如果只想用程序控制该excel而不想让用户操作时候,可以设置为false
    app.UserControl = true;
    Excel.WorkbookClass workbook =(Excel.WorkbookClass)app.Workbooks.Add("c:\\t1.xls");
    Excel.WorksheetClass worksheet=(Excel.WorksheetClass)workbook.Sheets.get_Item("[sheet1$]");//这里差错,,该怎么改
    if(worksheet==null)
    {
    statusBar1.Text =  "ERROR: worksheet == null";
    return;
    }
    Excel.Range range1=worksheet.get_Range("A1","A5");
                
    range1.Value2="rer";