Ver Mensaje Individual
  #43  
Antiguo 10-01-2012
Avatar de jejo1984
jejo1984 jejo1984 is offline
Miembro
NULL
 
Registrado: jun 2011
Posts: 39
Reputación: 0
jejo1984 Va por buen camino
Las variables que utilizo:
Código Delphi [-]
const
  xlCellTypeLastCell = $0000000B;
var
 Excel, Sheet,Book: OLEVariant;
 CantRow, CantCol, i, j : Integer;
 RangoMatriz: Variant;
 FileName:String;

La primera línea en que me marca lo siguiente:
Código Delphi [-]
Sheet := Excel.Workbooks[ExtractFileName(FileName)].WorkSheets[1];
Error: Incompatible types: got "AnsiString" expected "LongInt"

La segunda igual:
Código Delphi [-]
RangoMatriz := Excel.Range['A1',Excel.Cells.Item[CantRow,CantCol]].Value;
Error: Incompatible types: got "Constant String" expected "LongInt"

Pienso que el error es por:
ExtractFileName(FileName) y 'A1'
Responder Con Cita