Advertisement

05.16.2008 at 03:52AM PDT, ID: 23407850
[x]
Attachment Details

Writing a link to a merged cell with Spreadsheet::WriteExcel

Asked by mjcoyne in Perl Programming Language, Microsoft Excel Spreadsheet Software

I can't seem to get the write_url_range() function from Spreadsheet::WriteExcel (v. 2.20) to operate as expected:

#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;

my $workbook = Spreadsheet::WriteExcel->new("my_excelfile.xls");
my $mysheet = $workbook->add_worksheet("mysheet");

my $merged_hdr = $workbook->add_format(
    align => 'center',
    bold => '1',
    color => 'blue',
);

#$mysheet->merge_range('M5:N5', "EC number(s)", $merged_hdr);
## merge_range works correctly; puts token "EC number(s)" in M5:N5 merged cell

#$mysheet->write_url('M5', "http://www.chem.qmul.ac.uk/iubmb/enzyme/", "EC number(s)", $merged_hdr);
# write_url works correctly, writes link to http://www.chem.qmul.ac.uk/iubmb/enzyme/ with token "EC number(s)" at M5.
 
$mysheet->write_url_range('M5:N5', "http://www.chem.qmul.ac.uk/iubmb/enzyme/", "EC number(s)", $merged_hdr);
## write_url_range fails, puts token with link at M5, no merge -- same result as write_url

__END__


In the example above, I'm trying to merge cells M5 and N5, and have the contents of this merged cell be a link identified as "EC Number(s)".  However, the result of write_url_range() is the same as the result of write_url() -- the link and cell title is written correctly, but only to cell M5; no merge occurs.

Anyone have any ideas?
Start Free Trial
[+][-]05.16.2008 at 01:50PM PDT, ID: 21586337

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 02:04PM PDT, ID: 21586427

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, Microsoft Excel Spreadsheet Software
Sign Up Now!
Solution Provided By: RSLE
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.16.2008 at 02:34PM PDT, ID: 21586627

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628