Open an excel file
Posted: Thu Mar 31, 2011 7:09 pm
I wonder if someone has a routine to open the excel file and play all the cells in a TXT or DBF.
Thanks
Thanks
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
If you are trying to retrieve data from the used rows of excel, then you can use the following commands. There are many ways and this is one among them.Now how do you know if I got to the end of the file
Code: Select all
// Retrieves the Used Rows and Column count
nTotRowCount := oSheet:UsedRange:Rows:Count()
nTotColCount := oSheet:UsedRange:Columns:Count()
MsgInfo("Used Rows :"+Str(nTotRowCount)+CRLF+"Used Cols :"+Str(nTotColCount))
//You can use nTotRowCount to process further. For eg.
nCurRow :=1
Do while nCurRow <= nTotRowCount
? oSheet:Cells(nCurRow,1):Value
nCurRow ++
Enddo
Code: Select all
// Method 2
nRow:=2
Do while !empty(oExcel:Cells(nRow, 1):Value)
nRow++
Enddo