Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to change sheet name with apache poi MS excel java android

is there any way to update existing sheet name of MS Excel file knowing that I am using apache poi in my android app

I can create a sheet with my custom name

HSSFSheet sheet = workbook.createSheet("my custom name"); 

but when I want to copy another sheet to this one , the name also is copied and my custom name is crashed

like image 772
funfordevelopping Avatar asked Feb 21 '14 18:02

funfordevelopping


1 Answers

The following should do the trick:

workbook.setSheetName(workbook.getSheetIndex(sheet), "newName"); 
like image 51
nikis Avatar answered Oct 04 '22 23:10

nikis