tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.87k stars 819 forks source link

Microsoft Office Excel shows warning message #629

Closed vasanth-c closed 4 years ago

vasanth-c commented 4 years ago

When open xlsx file in Microsoft Office Excel, It shows warning message, When use SheetView Pane in xlsx. But it's working fine in Wps office. Capture88

I use the following code

sheet.SheetViews = []xlsx.SheetView{ xlsx.SheetView{ Pane: &xlsx.Pane{ XSplit: 0, YSplit: 2, ActivePane: "bottomRight", TopLeftCell: "B2", State: "frozen", }, }, }

Any solution for this?

tealeg commented 4 years ago

@vasanth-c this is a fairly common class of issue with output from this library. Excel is extremely picky about what it considers valid (i.e. it's not a simple as being compliant with the standard) - everything else will read this just fine. Usually, the only way to find the issue is to compare the repaired file with the non repaired file. If you could provide both a broken and a valid example that would be helpful. If the data is not something you can share, then try to unzip the files (xlsx files are literally zip files full of XML) and diff them yourself, maybe?

vasanth-c commented 4 years ago

@tealeg this is broken file 00010's Menu WB (56).xlsx

when I open this in Microsoft Office Excel It shows

Repaired Records: View from /xl/worksheets/sheet1.xml part Repaired Records: View from /xl/worksheets/sheet2.xml part Repaired Records: View from /xl/worksheets/sheet3.xml part Repaired Records: View from /xl/worksheets/sheet4.xml part Repaired Records: View from /xl/worksheets/sheet5.xml part Repaired Records: View from /xl/worksheets/sheet6.xml part Repaired Records: View from /xl/worksheets/sheet7.xml part Repaired Records: View from /xl/worksheets/sheet8.xml part Repaired Records: View from /xl/worksheets/sheet9.xml part Repaired Records: Data validation from /xl/worksheets/sheet9.xml part Repaired Records: View from /xl/worksheets/sheet10.xml part Repaired Records: View from /xl/worksheets/sheet11.xml part Repaired Records: View from /xl/worksheets/sheet12.xml part Repaired Records: View from /xl/worksheets/sheet13.xml part Repaired Records: View from /xl/worksheets/sheet14.xml part Repaired Records: View from /xl/worksheets/sheet15.xml part Repaired Records: View from /xl/worksheets/sheet16.xml part

I removed following code In all sheets

sheet.SheetViews = []xlsx.SheetView{ xlsx.SheetView{ Pane: &xlsx.Pane{ XSplit: 0, YSplit: 2, ActivePane: "bottomRight", TopLeftCell: "B2", State: "frozen", }, }, }

In sheet9 I removed following code ======================= msg1 := "Serving size format should be ==> " + "If serving size only: (ss1 : 0; ss2 : 0; ...)." + "If serving size with prefixes:(ss1 : 0 | ss2 : 0 | ...)." + "If serving size with prefixes with setting price here:(ss1 : 0.25 | prefix1 : 0.15, prefix2 : 0.15; ss1 : 0.12 | prefix1 : 0.13, prefix2 : 0.14; ) "

validation.SetInput(&title, &msg1)

after removing this codes, it's working fine. The corrected file is 00010's Menu WB (57).xlsx

tealeg commented 4 years ago

Thanks @vasanth-c I'll look into this.

tealeg commented 4 years ago

@vasanth-c the problem is probably related to the massive number of columns in sheet9 - it exceeds the limits allowed in an xlsx file.

vasanth-c commented 4 years ago

@tealeg I removed sheet9(modifier) also from the file, but it still shows warning message.

vasanth-c commented 4 years ago

@tealeg thanks