Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Internal links in Excel

by Animator (Hermit)
on Oct 01, 2008 at 14:43 UTC ( #714805=note: print w/replies, xml ) Need Help??

in reply to Internal links in Excel


foreach my $link ( @links ) { my $url = "q{internal:'$link'!A1}"; $worksheet1->write_url ( $row,$col, $url,$label ); $row++; $col++; }


foreach my $link ( @links ) { my $url = "internal:'$link'!A1"; $worksheet1->write_url ( $row,$col, $url,$label ); $row++; $col++; }

I'm guessing your confusing comes from looking at the examples in Spreadsheet::WriteExcel and not knowing q() and qq().

The examples from Spreadsheet::WriteExcel:

$worksheet->write_url('A6', 'internal:Sheet2!A1' + ); $worksheet->write_url('A7', 'internal:Sheet2!A1', $format + ); $worksheet->write_url('A8', 'internal:Sheet2!A1:B2' + ); $worksheet->write_url('A9', q{internal:'Sales Data'!A1} + );

I'm guessing the $worksheet->write_url('A9',  q{internal:'Sales Data'!A1}); confused you but it means exactly the same as : $worksheet->write_url('A9',  'internal:\'Sales Data\'!A1');

In essence: q(foo) is the same 'foo' which is the same as q{foo} (that is: single quotes but you get to choose the delimiter).
qq(foo) is the same 'foo' which is the same as qq{foo} (that is: double quotes but you get to choose the delimiter).

I tested this by creating an xls file via Spreadsheet::WriteExcel and opening it in OpenOffice. Don't have access to Microsoft Excel at the moment of this writing.

Replies are listed 'Best First'.
Re^2: Internal links in Excel
by anand_perl (Novice) on Oct 03, 2008 at 04:06 UTC

    Thanks Animator!!!

    Your solution works!!
      'BATSOPLINK'!A1 this is the output I get when I try to print it via my $url = "internal:'$val$i'!A1"; Want to get rid of "!A1" and just want to print the value which refers to the cell

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://714805]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2018-05-23 17:31 GMT
Find Nodes?
    Voting Booth?