开发者

JXL rename a sheet

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜