Ver Mensaje Individual
  #3  
Antiguo 26-02-2009
Jose Roman Jose Roman is offline
Miembro
 
Registrado: jul 2006
Ubicación: Colombia
Posts: 361
Reputación: 18
Jose Roman Va por buen camino
Gracias por responder...
Tengo este procedimiento:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  ApXls : Variant;
  Libro : Variant;
  Hoja  : Variant;
begin
  try
    ApXls := CreateOleObject('Excel.Application');
    try
      ApXls.Visible := False;
      Libro := ApXls.WorkBooks.Add;
      Libro.Open('C:\Documents and Settings\LABORATORIO.FPINTO\Escritorio\COBRO.xls');
      ShowMessage(IntToStr(ApXls.WorkBooks.Worksheets.Count));
    finally
      ApXls.Quit;
      ApXls.Free;
    end;
  except

  end;
end;
Al tratar de saber cuantas hojas posee el libro de Excel abierto, me arroja este error:

EOleError with message 'Method 'Worksheets' not supported by automation object'.

No estoy utilizando componentes para abrir Excel solo las unidades ComObj y Excel2000.
Responder Con Cita