Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet name issue #51

Closed
rpokupec opened this issue May 10, 2017 · 2 comments
Closed

Sheet name issue #51

rpokupec opened this issue May 10, 2017 · 2 comments

Comments

@rpokupec
Copy link

Hi,

If I open a xlsx file and want to write to some cells in sheet where sheet name is not in format of "SheetX"
after xlsx file is saved, there is no entry in the cell if you open a file with Excel.
Another thing is if I use xlsx.CreateFile() I'm aware that I get only one sheet with name "Sheet1" and I can write to the cells of "Sheet1".
When I do xlsx.NewSheet(2, "Sheet2") I can write to cells in "Sheet2". But if instead od "Sheet2" I put "Test_1" for example, then if I write to some cells in this sheet, this cannot be seen in Excel.

Only workaround I found is to create new sheets with name "SheetX" then do whatever you need and before saving use xslx.SetSheetName("Sheet2", "Test_1") for example.

@xuri
Copy link
Member

xuri commented May 10, 2017

@rpokupec

  • You can use the GetSheetMap() function to get all sheets index and name map and use "Sheet" + index to set the cell value;
  • You should be set cell value by SetCellValue("Sheet2", ..., ...) after doing xlsx.NewSheet(2, "Test_1");
    In other words, function SetCellValue() and some other functions are doesn't support set cell value or get rows by sheet name currently, it needs to take the form of "Sheet"+index as a parameter. Relate issue Cannot set name to sheets #25, GetRows() does not work on 1.8.1 #43, and Newsheet is empty SetCellValue? #47.

@rpokupec
Copy link
Author

Ok.
Thank you for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants