>oExcel = CREATEOBJECT([Excel.Application]) >WITH oExcel > .Workbooks.Open(GETFILE()) > ?.Worksheets("Sheet1").UsedRange.Rows.Count >* or > ?.ActiveSheet.UsedRange.Rows.Count > .Workbooks.Close() >ENDWITH >oExcel=.F.>
#Define xlA1 1 #Define xlLastCell 11 lcXLS = Sys(5)+Curdir()+'customer.xls' oExcel = Createobject('Excel.application') oExcel.Workbooks.Open(lcXLS) With oExcel.Activeworkbook.ActiveSheet lcLastCell = .Range("A1").SpecialCells(xlLastCell).Address(.F.,.F.,xlA1) ? 'Last Cell',lcLastCell With .UsedRange ? 'Used Range Address',.Address(.F.,.F.,xlA1) ? 'Used Range Rows',.Rows.Count, 'Cols', .Columns.Count Endwith lcFirstUnusedRowCol = "A"+; Transform(Int(Val(Chrtran(; lcLastCell,Chrtran(lcLastCell,'0123456789',''),''))+1)) ? 'First Column at First unused row',lcFirstUnusedRowCol .Range(lcFirstUnusedRowCol).Activate Endwith oExcel.Visible = .T.Cetin