Ver Mensaje Individual
  #2  
Antiguo 04-07-2011
Avatar de newtron
[newtron] newtron is offline
Membrillo Premium
 
Registrado: abr 2007
Ubicación: Motril, Granada
Posts: 4.214
Reputación: 24
newtron Va camino a la fama
Hola.

Aquí llevas un ejemplo.

Código Delphi [-]
procedure TFormImportaExcel.NTButton1Click(Sender: TObject);
var
  appExcel : Variant;
  N, Hoja : SmallInt;
  contenido : String;
begin
  appExcel := CreateOleObject('Excel.Application');
  appExcel.WorkBooks.Open('C:\ARCHIVO.XLS');
  Hoja:=1;
  N:=0;
  while true do begin
    Inc(N);
    Contenido := appExcel.WorkBooks[1].Worksheets[Hoja].Cells[N,1];
    if Contenido='' then break
  end;
  appExcel.Quit;
  appExcel := Unassigned;
end;

Espero que te sirva.
Saludos
Responder Con Cita