qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.64k stars 1.69k forks source link

How to insert new data into an existing sheet table and preserve the previous data. #1855

Closed TELstatic closed 3 months ago

TELstatic commented 3 months ago

Description

The document states "NewStreamWriter returns stream writer structure by given worksheet name used for writing data on a new existing empty worksheet with large amounts of data."

When i try writing new data, the previous data was missing.

Steps to reproduce the issue: 1. 2. 3.

Describe the results you received:

Describe the results you expected:

Output of go version:

go version go1.22.0 windows/amd64

Excelize version or commit ID:

v2.8.1

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

xuri commented 3 months ago

Thanks for your issue. If you are reporting a new issue, make sure that we do not have any duplicates already exist. This was duplicated with issues #1445, #1537, and #1598. As the documentation says, the stream writer used to generate the new worksheet doesn't support appending data to the existing worksheet, so please use the normal mode function SetSheetRow instead of the SetRow function to append/modify cell value. I've closed this issue. If you have any questions, please let me know, and you can reopen this anytime.