Linking to workbooks

11 views
Skip to first unread message

shawn wilson

unread,
Apr 8, 2015, 9:18:11 AM4/8/15
to spreadsheet...@googlegroups.com
I'm trying to link to another workbook by name.

So I do this:

    $oWS->write($sCount, 0, "internal:\'$sIssue\'!A!", $phFormats->{link});

And then I create the workbook with the same name:

    my $oWS = $oWB->add_worksheet($sIssue);

From the pod, it doesn't seem like I need the !A1 but it isn't working with or without it. I am creating the workbook after creating the link (I don't think this is a problem but figured I'd mention it just in case).

jmcnamara

unread,
Apr 8, 2015, 9:58:08 AM4/8/15
to spreadsheet...@googlegroups.com

Hi Shawn,

Are you trying to link to a workbook or a worksheet. The text says workbook but the code say worksheet.

Have a look at the example in the docs that shows how you link to both:

    http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX/Examples.pm#Example:_hyperlink2.pl

Regards,

John


 

shawn wilson

unread,
Apr 8, 2015, 10:26:55 AM4/8/15
to spreadsheet...@googlegroups.com
On Wed, Apr 8, 2015 at 9:58 AM, jmcnamara <jmcn...@cpan.org> wrote:
>
>
>
> On Wednesday, 8 April 2015 14:18:11 UTC+1, shawn wilson wrote:
>>
>> I'm trying to link to another workbook by name.
>>
>> So I do this:
>>
>> $oWS->write($sCount, 0, "internal:\'$sIssue\'!A!", $phFormats->{link});
>>
>> And then I create the workbook with the same name:
>>
>> my $oWS = $oWB->add_worksheet($sIssue);
>>
>> From the pod, it doesn't seem like I need the !A1 but it isn't working with or without it. I am creating the workbook after creating the link (I don't think this is a problem but figured I'd mention it just in case).
>
>
> Hi Shawn,
>
> Are you trying to link to a workbook or a worksheet. The text says workbook but the code say worksheet.
>

Uh yeah, worksheet :)

> Have a look at the example in the docs that shows how you link to both:
>
> http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX/Examples.pm#Example:_hyperlink2.pl
>

Yeah. So is there any issue with my quoting with ->write or using/not
using a col/cel position and is my quoting correct?

jmcnamara

unread,
Apr 8, 2015, 11:30:22 AM4/8/15
to spreadsheet...@googlegroups.com


On Wednesday, 8 April 2015 15:26:55 UTC+1, shawn wilson wrote:

Yeah. So is there any issue with my quoting with ->write or using/not
using a col/cel position and is my quoting correct?

Hi Shawn,

It is almost impossible to say based on 2 lines of code. You will have to post a small working example to demonstrate the issue.

The issue may be that you have a typo in the link code. The cell reference is A! and not A1. But that is just a guess without seeing a small working example.

John

 

shawn wilson

unread,
Apr 8, 2015, 12:11:23 PM4/8/15
to spreadsheet...@googlegroups.com
I literally just figured it out:
$oWS->write($sCount, $sCol++, 'internal:\'' . $sIssue . '\'!A1',
$phFormats->{link}, $sIssue);

I'm not sure why:
$oWS->write($sCount, 0, "internal:\'$sIssue\'!A!", $phFormats->{link});
Didn't work (I suspect something I did with quoting.

On Wed, Apr 8, 2015 at 11:30 AM, jmcnamara <jmcn...@cpan.org> wrote:
>

> The issue may be that you have a typo in the link code. The cell reference
> is A! and not A1. But that is just a guess without seeing a small working
> example.
>

Ahha, I see that now. Thanks.
Reply all
Reply to author
Forward
0 new messages