lcXLBook = Getfile('xls, xlsx, xlsm, xlsb', 'Archivo:', 'Aceptar', 0, 'Seleccione una hoja de cálculo')
If Empty(m.lcXLBook)
Return .F.
Endif
If Not File(m.lcXLBook)
Messagebox("Archivo no encontrado", 16)
Return .F.
Endif
Local loExcel As Excel.Application
loExcel = Createobject("Excel.application")
If Vartype(m.loExcel, .T.) <> 'O'
Messagebox("No se puede procesar el archivo porque no tiene la aplicación" ;
+ Chr(13) + "Microsoft Excel instalada en su computador.", 16)
loExcel = Null
Release m.loExcel
Return .F.
Endif
m.loExcel.Workbooks.Open(m.lcXLBook)
m.loExcel.Sheets(1).Select
With m.loExcel.ActiveWorkBook.ActiveSheet
loLastCell = .Cells.SpecialCells( xlLastCell )
lnLastRow = m.loLastCell.Row
lnLastCol = m.loLastCell.Column
ENDWITH
MessageBox(lnLastRow)
MessageBox(lnLastCol)
loExcel.ActiveWindow.Close(.F.)
loExcel.Quit()
loExcel = Null