FastExcel icon indicating copy to clipboard operation
FastExcel copied to clipboard

Use single-sheet Excel filename

Open randsu opened this issue 5 years ago • 3 comments

If exists in zip, then use constant for filename, don't postfix filename with sheet number in this case.

I encountered this problem in some recent Excel .xlsx files, and fixed it in my clone. This is probably a naive implementation, and I suspect this problem has something to do with the "standalone" xml attribute.

randsu avatar Jan 14 '21 13:01 randsu

This is an interesting post, stating that you should look up the relationsships for workbook => sheets in _xl\rels\workbook.xml.rels and not rely on a fixed protocol for numbering.

https://github.com/tidyverse/readxl/issues/104#issuecomment-165153525

However, I still cannot reproduce having sheet.xml, after I save its back to sheet1.xml. Could be a flaw or non-standard way of creating Excel files from this 3rd party application.

randsu avatar Jan 19 '21 13:01 randsu

The issue you linked seems to be correct. Currently, there are two issues that would be fixed by this,

  • If the sheet doesn't have a number, you won't be able to access it.
  • If you change the order of the sheets, it won't be reflected. So you would still get the first sheet sheet1with the name of sheet2.

If you want to work on this, I will merge it.

ahmedwalid05 avatar Jan 19 '21 16:01 ahmedwalid05

I hope I can get time to look at it, and contribute to this nice repo, which is easy to use, standalone and effective.

randsu avatar Jan 19 '21 20:01 randsu