Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Servers
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #20  
Antiguo 10-01-2012
Avatar de jejo1984
jejo1984 jejo1984 is offline
Miembro
NULL
 
Registrado: jun 2011
Posts: 39
Poder: 0
jejo1984 Va por buen camino
Claro que si voy a pegar nuevamente el código y de color rojo las líneas donde aparece el error:
Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
const
  xlCellTypeLastCell = $0000000B;
var
 Excel, Sheet,Book: OLEVariant;
 CantRow, CantCol, i, j : Integer;
 RangoMatriz: Variant;
 FileName:String;

begin
  FileName:='C:\SISTEMAPLANILLAS\Libro2.xlsx';
  try
  Excel := CreateOleObject('Excel.Application');
  Excel.Workbooks.Open(FileName);
  ShowMessage(FileName);
  Sheet := Excel.Workbooks[ExtractFileName(FileName)].WorkSheets[1];
  Sheet.Cells.SpecialCells(xlCellTypeLastCell, EmptyParam).Activate;

  CantRow := Excel.ActiveCell.Row;
  CantCol := Excel.ActiveCell.Column;

  RangoMatriz := Excel.Range['A1',Excel.Cells.Item[CantRow,CantCol]].Value;

  for i:=1 to CantRow do
   begin
    for j:=1 to CantCol do
     begin
      Showmessage(RangoMatriz[i,j]);
      //haces todo lo que necesites hacer
     end;
   end;//for
   finally
   Excel.Quit; //Aquí cerramos la hoja de Excel
   end;
end;

Como comente le agregue StrToInt funca normal pero ya se perdería pues por que ya pasa a integer.
Como podre solucionarlo...
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
importar datos de excel a firebird Choclito Varios 6 06-02-2007 02:26:10
como importar informacion a mi base de datos desde un disket ibbeth Firebird e Interbase 13 20-01-2007 10:18:38
Importar desde Excel Lucas_diaz1810 Conexión con bases de datos 5 03-11-2006 18:15:26
Importar desde Excel LucasArgentino SQL 1 24-12-2003 17:33:26
importar datos de excel a mi aplicacion squenda Varios 2 11-12-2003 03:33:32


La franja horaria es GMT +2. Ahora son las 12:44:04.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi