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

Auto Filter disappears when renaming sheet #1792

Closed
jpmeijers opened this issue Jan 26, 2024 · 1 comment · Fixed by #1797
Closed

Auto Filter disappears when renaming sheet #1792

jpmeijers opened this issue Jan 26, 2024 · 1 comment · Fixed by #1797
Labels
bug Something isn't working

Comments

@jpmeijers
Copy link

Description

Similar to #324. When a sheet is renamed, a filter added before the rename is lost.

Steps to reproduce the issue:

  1. Add a filter with f.AutoFilter("Sheet1", "A2:T18", []excelize.AutoFilterOptions{})
  2. Rename the sheet f.SetSheetName("Sheet1", "Test Sheet")
  3. Open in Excel/LibreOffice and the filter is not there

Describe the results you received:
The filter is dropped when the sheet is renamed

Describe the results you expected:
A filter should survive a sheet rename

Output of go version:

go version go1.19.3 linux/amd64

Excelize version or commit ID:

github.com/xuri/excelize/v2 v2.7.1

Environment details (OS, Microsoft Excel™ version, physical, etc.):
Ubuntu 23.10

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-US (en_ZA.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.4-0ubuntu0.23.10.1
Calc: threaded

@xuri xuri added the bug Something isn't working label Jan 27, 2024
ooooooobh added a commit to ooooooobh/excelize that referenced this issue Jan 28, 2024
xuri pushed a commit that referenced this issue Jan 29, 2024
@xuri
Copy link
Member

xuri commented Jan 29, 2024

Thanks for your issue. This bug has been fixed, please upgrade to the master branch code by go get -u github.com/xuri/excelize@master, and this patch will be released in the next version. Note that, as the documentation of this function says, it only changes the name of the sheet and will not update the sheet name in the formula or reference associated with the cell. So there still may be problem formula error or cell reference missing after this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants