RT 谢谢

解决方案 »

  1.   

    http://www.21tx.com/dev/2004/07/09/11656.html#baidusnap3VBA指南。
      

  2.   

    uses   ComObj;   
        
      var   Excel:   OleVariant;   
              MaxRow,MaxCol:   integer;   
      begin   
          try   
              Excel := CreateOLEObject('Excel.Application');   
          except   
              ShowMessage('Excel没有安装');   
              Exit;   
          end;   
          try   
              Excel.WorkBooks.Open('c:\123.xls');   
              MaxRow:=Excel.WorkSheets[1].UsedRange.Rows.Count;   
              MaxCol:=Excel.WorkSheets[1].UsedRange.Columns.Count;   
              ShowMessage(Format('%d   %d',[MaxRow,MaxCol]));   
          finally   
              Excel.Quit;   
          end;   
      end