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

File corrupted caused by remove rows #387

Closed
hehehahayang opened this issue Apr 22, 2019 · 3 comments
Closed

File corrupted caused by remove rows #387

hehehahayang opened this issue Apr 22, 2019 · 3 comments

Comments

@hehehahayang
Copy link

hehehahayang commented Apr 22, 2019

编辑原有excel.xlsx,某一些行有merge格时,然后 把这行remove后,save,在win下报开,会报错。linux下没报错(libre, ubuntu18)。应该是remove rows时没把style之类信息删除。

另:能否加一个功能,从某个sheet里复制某一行到另一个sheet里?

@hehehahayang hehehahayang changed the title 老哥,删除白粉 老哥,删除rows时,不够干净,win下报错 Apr 22, 2019
@xuri
Copy link
Member

xuri commented Apr 22, 2019

Hi @ballyang, please provides the version of excelize and Go you are using, and the xlsx file attachment if you can. Also reference #372.

@xuri xuri added the needs more info This issue can't reproduce, need more info label Apr 22, 2019
@hehehahayang
Copy link
Author

Hi @ballyang, please provides the version of excelize and Go you are using, and the xlsx file attachment if you can. Also reference #372.

  • env:

  • go: go version go1.11.9 linux/amd64

  • ubuntu18

  • excelize: latest,已经goget最新的下来了

  • go demo
    `
    tmp := "./test1.xlsx"

    t1, err := excelize.OpenFile(tmp)
    if err != nil {
    log.Fatal(err)
    }

    for x := 10; x >= 5; x-- {
    t1.RemoveRow("Sheet1", x)
    }
    t1.SaveAs("./test1.save.xlsx")
    `

  • excel file:

  • test1.xlsx

  • 我只是把后面那几行remove掉,但在win下打开,就会报‘Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃’类似错误

@xuri xuri closed this as completed in 095b5fb Apr 22, 2019
@xuri
Copy link
Member

xuri commented Apr 22, 2019

Hi @ballyang, thanks for your issue, I have fixed it.

@xuri xuri removed the needs more info This issue can't reproduce, need more info label Apr 22, 2019
@xuri xuri changed the title 老哥,删除rows时,不够干净,win下报错 File corrupted caused by remove rows Jul 28, 2019
nullfy pushed a commit to nullfy/excelize that referenced this issue Oct 23, 2020
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