I have a workbook with 4 tabs.
I call the TABs sheet!!!!!
At any rate, I use the following code to set the first sheet ( The first TAB
) to be selected.
My code looks like this:
Workbook wb = getCurrentWorkbook();
for (int ix = 0; ix < wb.getNumberOfSheets(); ix++) {
sheet = workbook.getSheetAt(ix);
sheet.setSelected(false);
}
Sheet sheet = workbook.getSheetAt(0);
sheet.setSelected(true);
workbook.setSelectedTab((short) 0);
It does not work. After above code my first and last tabs are selected, but
the data that Excel Displays is the data for the last TAB.
All I want to do, is to load a workbook with 4 tabs, and at then end, when
user edits the Excel, he sees the first TAB (SHEET's) data.
Thanks a lot, and I am looking forward to your answer.
FredJ
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/have-a-workbook-with-4-sheets-Can-not-set-selected-sheet-to-the-first-sheet-tp5710295.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]