Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename Excel worksheet using xlsxwriter

How do i rename excel worksheet using xlsxwriter in python. I am using python 2.7 in linux to create excel reports. But cannot find an option to rename the tabs

like image 494
kten Avatar asked Jan 02 '17 05:01

kten


1 Answers

You can set the name of a worksheet while adding it via add_worksheet():

worksheet = workbook.add_worksheet('My Custom Name')

Note that you cannot set the name of an existing worksheet:

There is no set_name() method. The only safe way to set the worksheet name is via the add_worksheet() method.

like image 182
alecxe Avatar answered Oct 24 '22 07:10

alecxe