Link to home
Start Free TrialLog in
Avatar of developingprogrammer
developingprogrammer

asked on

determine total rows in Excel sheet (2003 or 2007)

hey guys,

i've got this code

        Select Case penmExcelVersion
            Case enmExcel2003
                intLastRowOfSheet = 65536
            Case enmExcel2007
                intLastRowOfSheet = 1048576
        End Select

Open in new window


Question: what's the best way to check if the excel sheet i'm looking at has 65536 rows or 1048576 rows?

Homework: i can't use Application.Version because Excel 2007 can also create Excel 2003 sheets (.xls) which has 65536. i can't use the extension name (or rather it's not that reliable) because if i'm detecting for .xls, what if there's an xlt? yes i can list down all the Excel 2003 extensions but doesn't seem very elegant.
SOLUTION
Avatar of Peter Kwan
Peter Kwan
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of developingprogrammer
developingprogrammer

ASKER

whao fantastic guys! i've always been looking for something like this but using workarounds instead - now i feel so much more like a complete person ha = ) thanks guys!! = ))