Comments (16)
It appears the file can be read in Excel, but it reports (and fix) errors.
from rubyxl.
Excel complains about xl/workbook.xml and xl/worksheets/sheet1.xml
from rubyxl.
Does this also happen if you open an existing (good) excel file and save it through rubyXL, or only when rubyXL creates a blank file?
from rubyxl.
Hi, I've switched to another gem (simple_xlsx_writer) and currently I've not time to debug this problem. I'm sorry, I won't be able to help you with this bug :/
from rubyxl.
This should be fixed in version 1.1.10
from rubyxl.
It looks like I'm having the same issue using version 1.1.10 - opening a valid excel file and writing to it again gives me
"Excel found unreadable content in "text1.xlsx". Do you want to remove the contents of this workbook? If you trust the source of this workbook, click Yes"
then
"Excel was able to open the file by repairing or removing unreadable content" on yes.
Here's the log output:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error051680_01.xml</logFileName><summary>Errors were detected in file 'C:\Users\Thomas\Documents\My Dropbox\test1.xlsx'</summary>-<repairedParts summary="Following is a list of repairs:"><repairedPart>Repaired Part: /xl/worksheets/sheet1.xml part with XML error. Load error. Line 2, column 459.</repairedPart><repairedPart>Repaired Part: /xl/worksheets/sheet2.xml part with XML error. Load error. Line 2, column 459.</repairedPart><repairedPart>Repaired Part: /xl/worksheets/sheet3.xml part with XML error. Load error. Line 2, column 459.</repairedPart></repairedParts>-<removedFeatures summary="Following is a list of removed features:"><removedFeature>Removed Feature: View from /xl/worksheets/sheet1.xml part</removedFeature><removedFeature>Removed Feature: View from /xl/worksheets/sheet2.xml part</removedFeature><removedFeature>Removed Feature: View from /xl/worksheets/sheet3.xml part</removedFeature></removedFeatures></recoveryLog>
Also - my excel file
from rubyxl.
I have more information, here's the xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" mc:Ignorable="mv" mc:PreserveAttributes="mv:*"><dimension ref="A1:B2"/><sheetViews><sheetView tabSelected="1" view="normalLayout" workbookViewId="0" zoomScale="100" zoomScaleNormal="100"></sheetViews><sheetFormatPr baseColWidth="10" defaultRowHeight="13"/><sheetData><row r="1" spans="1:2" customFormat="0" s="0"><c r="A1" s="0" t="s"><v>0</v></c><c r="B1" s="0" t="s"><v>0</v></c></row><row r="2" spans="1:2" customFormat="0" s="0"><c r="A2" s="0" t="s"><v>0</v></c><c r="B2" s="0" t="str"><v>what</v></c></row></sheetData><sheetCalcPr fullCalcOnLoad="1"/><phoneticPr fontId="1" type="noConversion"/><pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5"/><pageSetup orientation="portrait" horizontalDpi="4294967292" verticalDpi="4294967292"/></worksheet>
And I believe the cause is the self-ending sheetView:
<sheetView tabSelected="1" view="normalLayout" workbookViewId="0" zoomScale="100" zoomScaleNormal="100"/>
I have no idea how to zip my xlsx back up to test - so I'll fiddle a little longer but hopefully this give you some insight to the cause of the issue.
from rubyxl.
(Actually I just realised I've misread the tag and that's not the issue - I now have no idea but hope I've given you some ideas)
from rubyxl.
I've found the Microsoft OOXML SDK tool to be somewhat helpful in tracking down these errors.
http://www.microsoft.com/download/en/details.aspx?id=5124
Give it a shot at validating your file and it might tell you what rubyXL is doing wrong (or give you an unhelpful error message, who knows?).
I'll look at your file tomorrow, also.
from rubyxl.
Cheers, will investigate!
from rubyxl.
I'm not getting any errors from this file. Is this the one you repaired?
Also, what version of excel are you using?
from rubyxl.
Extremely sorry about the delay - this is for a client project and I was caught up in another branch the rest of the week.
Looks like this issue is only in Office 2007 - 03 and 10 (mac) are not reporting this issue, I had a look at the XML productivity tool and found some things:
I've since found I don't need to support 2007 in this instance so it's no longer an issue for me - let me know if you'd like some more information to help debug this.
Cheers for the gem btw, saved me a lot of hassle :-)
from rubyxl.
I think I'm experiencing the same issue on Mac, when I do the following:
require 'rubyXL'
workbook = RubyXL::Workbook.new
workbook.worksheets << RubyXL::Worksheet.new('pirates')
workbook.worksheets[0].add_cell(0,0,'Are great!')
workbook.write "dickerydock.xlsx"
On opening this I get:
And the recovery log says:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>Repair Result to dickerydock 06954.xml</logFileName>
<summary>Errors were detected in file 'Macintosh
HD:Users:jjeffus:dev:test:dickerydock.xlsx'</summary>
<repairedRecords summary="Following is a list of repairs:">
<repairedRecord>Repaired Records: Worksheet properties from
/xl/workbook.xml (Workbook)</repairedRecord>
</repairedRecords>
</recoveryLog>
The recovered workbook has all the sheets but is missing the sheet names. Not sure what the issue is, using rubyXL 1.2.5 on ruby 1.9.2p290.
from rubyxl.
jeffuus, I'm experiencing the same as you.
I tried this and it works:
workbook.worksheets << RubyXL::Worksheet.new(workbook,'Sheet2')
I think that the problem is that Worksheet initializer expects the workbook. I've forked the project and l'm going to add a "create_worksheet" method to the Workbook class.
from rubyxl.
+1
from rubyxl.
"normalLayout" is indeed invalid value for "view" property. I have fixed this.
from rubyxl.
Related Issues (20)
- How to change the default data type of a column?
- RubyZip 3.0 will introduce breaking changes that rubyXL will currently depend upon HOT 1
- Got a string with a part missing when i read value from cell. HOT 1
- Cannot open xlsx file using rubyXL HOT 3
- cell and styles.xml HOT 1
- can't change border diagonal
- "Nokogiri::XML::SyntaxError (1:1: FATAL: Document is empty)" on parsing the buffer more than once HOT 1
- GitHub sponsor/open collective HOT 2
- `insert_column` with existing styled cell doesn't set cell `@worksheet`, causing failure in `LegacyCell#validate_worksheet` HOT 1
- How can I make a cell in the sheet dropdown list with accept multiple values? (multiple selection)? HOT 1
- Storage class not found for docProps/app.xml and xl/workbook.xml leading to error opening file
- AWS setup for E-mail processing HOT 1
- MissingFile error during send_file in rails
- Re-open #332
- undefined method `change_row_italics' HOT 1
- Obscure error raised when calling `parse_buffer` with an empty buffer HOT 1
- when i parse a xlsx file, change_contents not found. and how can i change merged cell content? HOT 1
- External link can not write to new file
- `#parse_buffer` unexpectedly modifies input buffer HOT 3
- Error Parsing Xlsx when it has links to other files
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 rubyxl.