Spreadsheet link to a file

A

as

Hi,


I'm looking for a way to create a link to a local file with the
spreadsheet gem. I can make a link to a site (see example below), but
what is the syntax for a file?

Thanks,

%%%%%
#!/usr/bin/env ruby
require 'rubygems'
require 'spreadsheet'

book = Spreadsheet::Workbook.new
sheet = book.create_worksheet
sheet[0,0] =
Spreadsheet::Link.new(url='http://www.google.fr',fragment="google")
book.write 'test.xls'
%%%%
 
A

as

Le Tue, 4 Aug 2009 08:47:37 -0500,
(e-mail address removed) a écrit :
Spreadsheet::Link.new(url='file:///path_to_file')
This should create the link

it does... thanks!
 
A

as

Le Tue, 4 Aug 2009 08:47:37 -0500,
(e-mail address removed) a écrit :
Spreadsheet::Link.new(url='file:///path_to_file')
This should create the link

it seems to only work for absolute path...
Spreadsheet::Link.new(url='file://./file') does not work

what about relative one?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top