java - Focus on first cell in excel -
hssfworkbook wb = new hssfworkbook(new fileinputstream(file)); hssfsheet s = wb.getsheetat(0); wb.setactivesheet(0); s.showinpane(0, 0); fileoutputstream out = new fileoutputstream(file); wb.write(out); out.close();
i using above code taking focus first cell (when open excel first cell shouldd selected). opening excel correctly because of showinpane
, selecting first cell not working.
something this
hssfworkbook wb = new hssfworkbook(new fileinputstream(file)); hssfsheet s = wb.getsheetat(0); s.setactive(true); hssfrow row = s.getrow(0); hssfcell cell = row.getcell(0); cell.setasactivecell(); fileoutputstream out = new fileoutputstream(file);
Comments
Post a Comment