Closed micred closed 9 years ago
Can you please link your sample file here.
Here: https://dl.dropboxusercontent.com/u/11188592/Workbook1.xls https://dl.dropboxusercontent.com/u/11188592/Workbook2.xls
With Workbook2.xls I also get "File error: data may have been lost" when opened.
Tested on Ruby 2.1.5, 2.1.2-p95 and 1.9.3-p547. Gem version 1.0.2 and latest from github (master branch).
Have you tried the solution you proposed?
How exactly do you suggest?
play with the row formatting, also see here: https://github.com/zdavatz/spreadsheet/blob/master/GUIDE.md
I had no luck. BTW the format look the same of a cell with a working link created by Excel and a cell with a link created by spreadsheet gem:
=> #<Spreadsheet::Format:0x007ffed28dd528 @font=#<Spreadsheet::Font:0x007ffed294c2e8 @name="Arial", @color=:text, @previous_fast_key=nil, @size=10, @weight=400, @italic=false, @strikeout=false, @outline=false, @shadow=false, @escapement=:normal, @underline=:none, @family=:swiss, @encoding=:iso_latin1>, @number_format="GENERAL", @rotation=0, @pattern=0, @bottom_color=:builtin_black, @top_color=:builtin_black, @left_color=:builtin_black, @right_color=:builtin_black, @diagonal_color=:builtin_black, @pattern_fg_color=:border, @pattern_bg_color=:pattern_bg, @regexes={:date=>/[YMD]/, :date_or_time=>/[hmsYMD]/, :datetime=>/([YMD].*[HS])|([HS].*[YMD])/, :time=>/[hms]/, :number=>/[#]/}, @used_merge=0, @horizontal_align=:default, @text_wrap=false, @vertical_align=:bottom, @rotation_stacked=false, @indent_level=0, @shrink=false, @text_direction=:context, @left=:none, @right=:none, @top=:none, @bottom=:none, @cross_down=false, @cross_up=false>
what formatting did you try? Please show the code.
Please also ask your question here: https://groups.google.com/forum/#!forum/rubyspreadsheet and also search that group.
Random trial and error to be honest :-) Ok, for reference: https://groups.google.com/forum/#!topic/rubyspreadsheet/Nn1nTaiQyI8 Thank you.
Try setting the format to "link" as in
row.format(3).number_format
How to set link?! I found only number, time, date format in documentation...
Still no hints? Thank you.
Not at the moment.
Hi, no any update?
Sorry, not yet.
Hi, I'm able to correctly add link to xls file when creating new worksheets (
book.create_worksheet
), but links added to an existing worksheet doesn't work.Example:
Workbook2.xls is an empty spreadsheet created by Excel for Mac 2011. I also try creating the file with LibreOffice and I got the same result.
Maybe I need to force cell reset before adding the hyperlink?!