如何将数据从excel导入stringGrid中,如果excel中的数据格式同stringGrid的表格格式不同时能否作判断?

解决方案 »

  1.   

    http://218.56.11.178:8020/web/technology.aspx-> 下载基地->例程-数据库/报表->动态调用Excel数据表用ADO连上,想普通数据库一样操作就可以了
      

  2.   

    用ADO连 ,extend 下加一个扩展参数 excel8.0就可以了
      

  3.   

    我想导入stringgrid中,怎么办呢?
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
     i,j: Integer;
     row,col: Integer;
    begin
     try
       //创建OLE对象Excel Application与 WorkBook
       eclApp:= CreateOleObject('Excel.Application');
       eclApp.workBooks.Add;
     except
       messagebox(handle,'您的机器里可能未安装Microsoft Excel或异常','无法生成',MB_OK
      or MB_ICONWARNING);
       Exit;
     end; eclApp.visible:= True;for i:= 1 to 9 do
     for j;=1 to 9 
        begin
           eclApp.Cells(j, i):= stringgrid1.cells[j,i];
        end;
       
    end.代码不全,请自已写全>