Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

Change:

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

Into:

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.


Comment on Re: Internal links in Excel
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://714805]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2014-12-27 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls