[GH-ISSUE #314] worksheet name #254

Closed
opened 2026-05-05 12:02:40 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @alimat-nz on GitHub (Nov 10, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/314

Originally assigned to: @jmcnamara on GitHub.

not sure if I am missing this in the documentation, or if this is a feature request.

I have recently installed libxlswriter, and using it from C I can not find how to rename a worksheet. When a new sheet is created it is sheet 1 2 3 etc as per the default in Excel. There is the ability to set a vbaname, but i can not see one that renames the sheet name that is displayed in excel, as is done when you right click and select rename, or double click on the worksheet name when in the excel application. Am I simply not finding the right function or should this be a feature request?

Thanks

Originally created by @alimat-nz on GitHub (Nov 10, 2020). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/314 Originally assigned to: @jmcnamara on GitHub. not sure if I am missing this in the documentation, or if this is a feature request. I have recently installed libxlswriter, and using it from C I can not find how to rename a worksheet. When a new sheet is created it is sheet 1 2 3 etc as per the default in Excel. There is the ability to set a vbaname, but i can not see one that renames the sheet name that is displayed in excel, as is done when you right click and select rename, or double click on the worksheet name when in the excel application. Am I simply not finding the right function or should this be a feature request? Thanks
gitea-mirror 2026-05-05 12:02:40 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jmcnamara commented on GitHub (Nov 10, 2020):

You can only set the name of the sheet when you create it. From the docs for workbook_add_worksheet():

The sheetname parameter is optional. If it is NULL the default Excel convention will be followed, i.e. Sheet1, Sheet2, etc.:

worksheet = workbook_add_worksheet(workbook, NULL  );     // Sheet1
worksheet = workbook_add_worksheet(workbook, "Foglio2");  // Foglio2
worksheet = workbook_add_worksheet(workbook, "Data");     // Data
worksheet = workbook_add_worksheet(workbook, NULL  );     // Sheet4

The name is used internally in a number of places so it intentionally can't be reset via the API.

<!-- gh-comment-id:724983534 --> @jmcnamara commented on GitHub (Nov 10, 2020): You can only set the name of the sheet when you create it. From the [docs](http://libxlsxwriter.github.io/workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e) for `workbook_add_worksheet()`: >The sheetname parameter is optional. If it is `NULL` the default Excel convention will be followed, i.e. Sheet1, Sheet2, etc.: ```C worksheet = workbook_add_worksheet(workbook, NULL ); // Sheet1 worksheet = workbook_add_worksheet(workbook, "Foglio2"); // Foglio2 worksheet = workbook_add_worksheet(workbook, "Data"); // Data worksheet = workbook_add_worksheet(workbook, NULL ); // Sheet4 ``` The name is used internally in a number of places so it intentionally can't be reset via the API.
Author
Owner

@alimat-nz commented on GitHub (Nov 10, 2020):

Thanks - as i said - I guess I missed it - thanks for the quick reply and an excellent bit of software!
Alistair Matthewamatthew@nz1.ibm.com 
 
----- Original message -----From: John McNamara notifications@github.comTo: jmcnamara/libxlsxwriter libxlsxwriter@noreply.github.comCc: alimat-nz amatthew@nz1.ibm.com, Author author@noreply.github.comSubject: [EXTERNAL] Re: [jmcnamara/libxlsxwriter] worksheet name (#314)Date: Wed, Nov 11, 2020 10:41 AM 
 
Closed #314.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
 

<!-- gh-comment-id:724988135 --> @alimat-nz commented on GitHub (Nov 10, 2020): Thanks - as i said - I guess I missed it - thanks for the quick reply and an excellent bit of software! Alistair Matthewamatthew@nz1.ibm.com    ----- Original message -----From: John McNamara <notifications@github.com>To: jmcnamara/libxlsxwriter <libxlsxwriter@noreply.github.com>Cc: alimat-nz <amatthew@nz1.ibm.com>, Author <author@noreply.github.com>Subject: [EXTERNAL] Re: [jmcnamara/libxlsxwriter] worksheet name (#314)Date: Wed, Nov 11, 2020 10:41 AM    Closed #314. —You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.  
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#254
No description provided.