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.