开发者

JXL rename a sheet

开发者 https://www.devze.com 2023-02-26 11:16 出处:网络
Hi I have a template excel which I load and would like to change a sheet name in that. 开发者_Python百科

Hi I have a template excel which I load and would like to change a sheet name in that.

开发者_Python百科
WritableWorkbook workbook = jxl.Workbook.createWorkbook(file1,template);

This workbook has n sheets. I would like to change the name of a single sheet. Incase of remove there is a method called

workbook.removeSheet(<sheet index>)

I dont find any such direct method for rename.

Can someone help me in this regard.


No direct method seems to exist. I'd try a copySheet(oldName, newName,newIndex) followed by a removeSheet(oldIndex)


workbook.createSheet("Name", i);
WritableSheet excelSheet = workbook.getSheet(i);

and to modify the name

excelSheet.setName("new name");
0

精彩评论

暂无评论...
验证码 换一张
取 消