Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Creating Hyperlink with a Excel Sheet

by poj (Abbot)
on Dec 19, 2014 at 13:37 UTC ( [id://1110854]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Creating Hyperlink with a Excel Sheet
in thread Creating Hyperlink with a Excel Sheet

Try
#!perl use strict; use Win32::OLE::Const 'Microsoft Excel'; Win32::OLE->Option(Warn => 3); my $ex = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $wb = $ex->Workbooks->Open('c:\\temp\\Book1.xlsx') ; my $ws = $wb->sheets('Sheet1'); $ws->Hyperlinks->Add({ Anchor => $ws->Range("A1"), Address => $wb->{name}, SubAddress => "Sheet2!B2", TextToDisplay => "Link to Sheet2", ScreenTip => "Sheet2", }); # save and exit $wb->SaveAs( 'c:\\temp\\changed.xlsx' ); undef $wb; undef $ex;
poj

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (9)
As of 2024-04-18 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found