How to Write hyperlinks using spreadsheet gem in Ruby?
The spreadsheet gem isnt documented properly, so I cant understand how can I write hyperlinks using sprea开发者_如何学编程dsheet gem. Can anyone tell me?
This script will create a spreadsheet with a link in the first cell
require 'rubygems'
require 'spreadsheet'
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet
sheet1[0,0] = Spreadsheet::Link.new 'www.google.com', 'link text'
book.write '/tmp/spreadsheet_with_link.xls'
According to the Guide you have to write to a new file name: https://github.com/zdavatz/spreadsheet/blob/master/GUIDE.md
精彩评论