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'