Comments (2)
ran into a similar thing using InsertRows
:
invalid column name "K31 E"
from excelize.
Some investigations:
Seems that the sheet I was reading and editing was using the same data validation twice.
inside of adjust.go
func (f *File) adjustDataValidations(ws *xlsxWorksheet, sheet string, dir adjustDirection, num, offset, sheetID int) error {
for _, sheetN := range f.GetSheetList() {
worksheet, err := f.workSheetReader(sheetN)
if err != nil {
if err.Error() == newNotWorksheetError(sheetN).Error() {
continue
}
return err
}
if worksheet.DataValidations == nil {
return nil
}
for i := 0; i < len(worksheet.DataValidations.DataValidation); i++ {
dv := worksheet.DataValidations.DataValidation[i]
if dv == nil {
continue
}
if sheet == sheetN {
fmt.Println("dv.Sqref", dv.Sqref) /// <<----------------HERE
ref, del, err := f.adjustCellRef(dv.Sqref, dir, num, offset)
it was feeding two ranges:
dv.Sqref K9:K31 E8:E30
which in turn blew up the insides of lib.go:rangeRefToCoordinates
func rangeRefToCoordinates(ref string) ([]int, error) {
rng := strings.Split(strings.ReplaceAll(ref, "$", ""), ":")
if len(rng) < 2 {
return nil, ErrParameterInvalid
}
fmt.Println(ref, "ref", rng[0], rng[1]) // HERE
return cellRefsToCoordinates(rng[0], rng[1])
}
output:
K9:K31 E8:E30 ref K9 K31 E8
Temporary fix for me was to remove the problematic datavalidations before editing the sheet:
if err := f.DeleteDataValidation(sheetName, "K9:K31", "E8:E30"); err != nil {
return err
}
from excelize.
Related Issues (20)
- GetPictureCells() Fail HOT 3
- Stream while appending to io.writer HOT 2
- Cloudflare Radar HOT 2
- WriteToBuffer function takes too long times HOT 1
- excelize.File does not implement io.WriterTo HOT 2
- Added picture is taking the whole sheet/view HOT 2
- concurrent use GetCellStyle got panic:index out of range HOT 2
- How can I set the `Fill` color for pie chart ? HOT 2
- When calling `Save` more than once on an already formatted Excel, the values are saved on unexpected cells HOT 2
- Different PieChart parts color and legend colors HOT 2
- Reduce Binary Size HOT 2
- Spark lines duplicate when creating spark lines on multiple sheets HOT 2
- Corrupted file HOT 2
- The brackets will be missing when setting up the arithmetic formula with brackets. HOT 1
- DuplicateRow() causes the parentheses to be lost in the formula of the row being duplicated HOT 1
- SetCellStr creates cells that are interpreted by excel with format "General" HOT 4
- Excelize v2.8.1 is causing process restart with performance data HOT 1
- Date Cells in Excel Exported as Numbers Instead of Dates HOT 2
- Reproducing tutorial the spreadsheet is empty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from excelize.