Code Monkey home page Code Monkey logo

Comments (16)

pepawel avatar pepawel commented on June 25, 2024

It appears the file can be read in Excel, but it reports (and fix) errors.

from rubyxl.

pepawel avatar pepawel commented on June 25, 2024

Excel complains about xl/workbook.xml and xl/worksheets/sheet1.xml

from rubyxl.

amanfredi avatar amanfredi commented on June 25, 2024

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.

pepawel avatar pepawel commented on June 25, 2024

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.

amanfredi avatar amanfredi commented on June 25, 2024

This should be fixed in version 1.1.10

from rubyxl.

anathematic avatar anathematic commented on June 25, 2024

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.

anathematic avatar anathematic commented on June 25, 2024

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.

anathematic avatar anathematic commented on June 25, 2024

(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.

amanfredi avatar amanfredi commented on June 25, 2024

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.

anathematic avatar anathematic commented on June 25, 2024

Cheers, will investigate!

from rubyxl.

amanfredi avatar amanfredi commented on June 25, 2024

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.

anathematic avatar anathematic commented on June 25, 2024

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:
xml productivity tool

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.

hexatridecimal avatar hexatridecimal commented on June 25, 2024

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:

http://d.pr/QE4r

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.

aviscasillas avatar aviscasillas commented on June 25, 2024

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.

maxstudener avatar maxstudener commented on June 25, 2024

+1

from rubyxl.

weshatheleopard avatar weshatheleopard commented on June 25, 2024

"normalLayout" is indeed invalid value for "view" property. I have fixed this.

from rubyxl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.