Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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]
[holli]: are you sure? or are they mere prjections of my hallucinating mind?
shmem feels uneasy over his guess of the tune for silent night, perl 6 night
[holli]: https://www. v=6H_9QEc6vA8
[holli]: meh, silent night
[holli]: also sad
[shmem]: halluzination beats newspaper in realism, sometimes

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-09-22 20:55 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (269 votes). Check out past polls.