Estimados.
Estoy intentando leer una planilla excel que tiene varias hojas de las cuales solo necesito los datos de una sola hoja.
He sacado el siguente codigo de un post anterior:
Código Delphi
[-]
const
xlCellTypeLastCell = $0000000B;
var
Filename : string;
Excel, Sheet: OLEVariant;
CantRow, CantCol, i, j : Integer;
RangoMatriz: Variant;
begin
OpenDialog.Execute();
FileName := OpenDialog.FileName;
Excel := ComObj.CreateOleObject('Excel.Application');
Excel.Workbooks.Open(FileName);
Sheet := Excel.Workbooks[ExtractFileName(FileName)].WorkSheets[1];
Sheet.Cells.SpecialCells(xlCellTypeLastCell, EmptyParam).Activate; <----- error
Excel.Workbook.Worksheets['LISTA']; <------- Hoja que me interesa
CantRow := Excel.ActiveCell.Row;
CantCol := Excel.ActiveCell.Column;
Me da error cuando intenta activar, dicha linea es necesaria ??
Desde ya se agradecen las sugerencias.
Saludos