weshatheleopard / rubyXL

Ruby lib for reading/writing/modifying .xlsx and .xlsm files
MIT License
1.27k stars 253 forks source link

Error message when open the generated file on MS Excel #331

Closed nusken closed 5 years ago

nusken commented 5 years ago

Hi @weshatheleopard

I'm trying to write my data on an Excel template. When I open the generated file on MS Excel on Window, I got an error message about a problem with file content as this screenshot. And this screenshot is the error details reported by Excel. You can download the broken file here

Actually, I usually encouter this issue. Previsouly, I worked around to fixed this issue. I found that if I remove all logo in the top left of each sheet, the issue will disappear. Then I will re-insert the logo again and everything might work fine (if it still be broken, I continue try and error with the logo). But this week, I have tried many times but had no success. Everytime I tried to re-insert this logo (I need this logo in the top left of this sheet) to the template like this screenshot ; then writting the file with rubyXL, the error message appears when opening the generated file with MS Excel.

Actually, I have not tried filling any data to any cell. I just tried to open the template with rubyXL and generate a file without any modification. Here is my code

workbook = RubyXL::Parser.parse(excel_template).tap do |w|
      w.calc_pr.full_calc_on_load = true
      w.calc_pr.force_full_calc = true
      w.calc_pr.calc_on_save = true
      w.calc_pr.concurrent_calc = true
      w.calc_pr.calc_completed = true
    end
workbook.write(file.path)

I'm using version 3.3.29. I also try with version 3.3.33, same result as 3.3.29. If you need any information to debug, please let me know. Thanks.

nusken commented 5 years ago

@weshatheleopard

When you're available, please take a look at my issue. It's very important to me. Thank you very much.

schorsch commented 5 years ago

got a similar problem, but i dont add any images. I have no idea from where it originates but it is very annoying.

nusken commented 5 years ago

No news, so sad :(

nusken commented 5 years ago

@weshatheleopard could you please take a look at this issue?

weshatheleopard commented 5 years ago

@nusken Unable to reproduce. I open your file in most recent rubyXL, then save it, and Excel opens it without any issues.