Excel - some tables - Excel found unreadable data

Excel - some tables - Excel found unreadable data

SeannSeann Posts: 6Questions: 0Answers: 0

Hi Allan,

Buttons is great - thanks.

I have an issue with only some excel tables - when you try to open them I get
"Excel found unreadable content in 'XXXX.xlsx'. Do you want to recover."etc

When you click to open anyway you get the message ' Excel was unable to open the flle by repairing or removing the unreadable content'

It say illegal character at column 16193

I unzipped the xlsx and proceeded to the said column in the workbook. In two seperate - misbehaving tables the erroneous data was the same

It pointed to the n in 'Fitness & ' ?

Thanks for the great work

Replies

  • SeannSeann Posts: 6Questions: 0Answers: 0

    An Update on this one. On another table the error points to the a in 'Health &'

    Think it might be something to do with the ampersand & ?

  • SeannSeann Posts: 6Questions: 0Answers: 0
    edited August 2015

    If anybody else has this issue, I got around it by doing this.

    Replace line 511 in buttons.html5.js

    return '<row>' + cells.join('') + '</row>';
    

    with this

    var theLine = cells.join('');
    var theLineReplaced = theLine.replace("&", "&#038;");
    return '<row>' + theLineReplaced + '</row>';
    

    Note the second & in the replace above should be ' ampersand hash zero three eight colon' it gets converted to an ampersand automatically here.

    Working great.

  • allanallan Posts: 61,944Questions: 1Answers: 10,157 Site admin

    Hi,

    Thanks for your posts on this. I've just been experimenting with ampersands in the file, and making the change you suggest appears to cause some issues - specifically of it have & amp; (without the space, which is so the forum doesn't render it) then it would become & #038;amp; which Excel then renders as & amp; (again without the space).

    Without the change, then Excel renders & amp; just like a browser would.

    Could you link to your page so I can take a look and try to correct this please? I'm hoping to get Buttons 1.0.1 out today, and would like to get this fix in if possible, but I've not been able to recreate the issue yet.

    Thanks,
    Allan

  • geodevgeodev Posts: 4Questions: 0Answers: 0
    edited August 2015
  • allanallan Posts: 61,944Questions: 1Answers: 10,157 Site admin

    Excellent - thanks you for the link! I will take a look into this shortly (doing my morning support rounds first :-) ).

    Allan

  • jego026jego026 Posts: 3Questions: 0Answers: 0
    edited August 2015

    Hello Allan,

    I found an additional problem related to this.
    Excel gives me the same error if a cell has a content like this '6150E-6503'. I think it is confusing it with a number and trying to do something with it.

    I am also experiencing the problem if a cell has a '&' in its content.

    Thanks, Jorge

  • allanallan Posts: 61,944Questions: 1Answers: 10,157 Site admin

    Thanks for the test case about the ampersand. I've committed a fix and Buttons 1.0.3 will contain the fix.

    I've still to look into the 6150E-6503 error (the fix for which won't be in 1.0.3 I'm afraid).

    Allan

  • jego026jego026 Posts: 3Questions: 0Answers: 0

    Allan,

    I was able to fix my problem (a cell containing something like: 6150E-6503 ) by checking if e- is part of a number and not passing it as a number to excel.
    I changed the following line in my copy of the buttons code:

    js b.push(g.isNumeric(a[c]) && (a[c] + '').toLowerCase().indexOf("e-") === -1?'<c t="n"><v>'+a[c]+"</v></c>":'<c t="inlineStr"><is><t>'+a[c].replace(/&(?!amp;)/g,"&amp;")+"</t></is></c>");

  • allanallan Posts: 61,944Questions: 1Answers: 10,157 Site admin

    Thanks for posting back! I'll get this integrated for the next release.

    Allan

  • allanallan Posts: 61,944Questions: 1Answers: 10,157 Site admin

    I've just committed the change. It is in the nightly version now and will be in the next release.

    Allan

  • jego026jego026 Posts: 3Questions: 0Answers: 0

    Thank you!

This discussion has been closed.