Question Find total rows & columns in xlsx

rzr

Member
Hello All,

It may be very obvious but can't figure this out this afternoon. I'm trying to load a xlsx file into a temp-table.
Before I do that is there way to determine how many rows and columns does this file contain, so I know how many rows & columns I need to loop through?
 

rzr

Member
this is the code I'm using to read cell.

Code:
REPEAT iRow = 1 TO 4 :                                   
                                                         
    MESSAGE                                              
        hWorkSheet:Range("A":U + STRING(iRow)):VALUE SKIP
        hWorkSheet:Range("B":U + STRING(iRow)):VALUE SKIP
        hWorkSheet:Range("C":U + STRING(iRow)):VALUE SKIP
        hWorkSheet:Range("D":U + STRING(iRow)):VALUE SKIP
        hWorkSheet:Range("E":U + STRING(iRow)):VALUE     
        VIEW-AS ALERT-BOX INFO BUTTONS OK.               
END.
 

Cecil

19+ years progress programming and still learning.
Are you using Excel com-object to extract data from the the xlsx file or are you parsing the XML to get the cell data?
 

rzr

Member
Perfect Thanks Cecil !!

the below code gets the "Range" and then from there on I can get the RowCount & ColumnCount.

Code:
hObjectRange   = hWorkSheet:UsedRange      
iRowCount      = hObjectRange:Rows:count
iColCount      = hObjectRange:Columns:count.
 

Cecil

19+ years progress programming and still learning.
Perfect Thanks Cecil !!

the below code gets the "Range" and then from there on I can get the RowCount & ColumnCount.

Code:
hObjectRange   = hWorkSheet:UsedRange     
iRowCount      = hObjectRange:Rows:count
iColCount      = hObjectRange:Columns:count.
:)
 
Top