How to count the MS Excel spreadsheet number & the spreadsheet name?

Anyone knows how to count the MS Excel spreadsheet number & the spreadsheet name?
[92 byte] By [anlipsa] at [2007-10-2 21:08:32]
# 1
what do you want to do?You want find ways to access excel file in Java?Or you have already found an API but don't know how to use it to count spreadsheet number?
happymustanga at 2007-7-13 23:54:21 > top of Java-index,Java Essentials,Java Programming...
# 2
dear happymustang,I want to count now many spreadsheet and get all the spreadsheet name within a excel wookbook, do you know any ways to do this?I have searched the POI, but didn't found such method to do this.
anlipsa at 2007-7-13 23:54:21 > top of Java-index,Java Essentials,Java Programming...
# 3
I just browse the POI doc and it seems there should be a easy solution..give me some time and i'll get back to you asap
happymustanga at 2007-7-13 23:54:22 > top of Java-index,Java Essentials,Java Programming...
# 4
here you are: http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#getNumberOfSheets()
happymustanga at 2007-7-13 23:54:22 > top of Java-index,Java Essentials,Java Programming...
# 5
Oh, thanks a lot!Let me try it first. ^^
anlipsa at 2007-7-13 23:54:22 > top of Java-index,Java Essentials,Java Programming...
# 6
You might not need POI. JDBC can do it. Use DatabaseMetaData to get the available worksheets. It looks just like a relational database, as long as the worksheets look like tables.%
duffymoa at 2007-7-13 23:54:22 > top of Java-index,Java Essentials,Java Programming...