PB reading Excel
String ls_filename
Ls_filename = " C: \ x1.xls "
Oleobject ole_excel
Ole_excel = create oleobject
IfOle_excel.connecttonewobject ("Excel. Application") <> 0 then
MessageBox (" ","Connect Excel error!")
Return
End If
Ole_excel.workbooks.open (ls_filename, 0,False)
Int li_rowscount, li_columnscount
String ls_cell
// Get rows count // li_rowscount = ole_excel.workbooks [1]. Sheets [1]. usedrange. Rows. countli_rowscount = 0
Do While True
Ls_cell = string (ole_excel.workbooks [1]. Sheets [1]. cells (li_rowscount + 1, 1). value)
If Isnull (ls_cell) then
Exit
Else
Li_rowscount ++
End If
Loop
// Get columns count // li_columnscount = ole_excel.workbooks [1]. Sheets [1]. usedrange. Columns. countli_columnscount = 0
Do While True
Ls_cell = string (ole_excel.workbooks [1]. Sheets [1]. cells (1, li_columnscount + 1). value)
If Isnull (ls_cell) then
Exit
Else
Li_columnscount ++
End If
Loop
String msg
MSG = " Rows count: " + String (li_rowscount) + " ~ R ~ Ncolumns count: " + String (li_columnscount)
MessageBox ( "" , MSG)
// Get cell value
Ls_cell = string (ole_excel.workbooks [1]. Sheets [1]. cells (2, 1). value)
IfIsnull (ls_cell) then
MessageBox ("Cell Value","Cell is null")
Else
MessageBox ("Cell Value", Ls_cell)
End If
Ole_excel.quit ()
Ole_excel.disconnectobject ()
Destroy ole_excel
PS: I don't know how many people use petabytes.