JoeStevens has asked for the wisdom of the Perl Monks concerning the following question:

I've been playing with the win32::OLE module and need to figure out how to place a hyperlink into an Excel spreadsheet. Can anyone help?

Replies are listed 'Best First'.
Re: Win32::OLE and excel hyperlinks
by jmcnamara (Monsignor) on Aug 16, 2002 at 15:53 UTC

    Here is a short example:
    #!/usr/bin/perl -w use strict; use Cwd; use Win32::OLE; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add; my $worksheet = $workbook->Worksheets(1); my $range = $worksheet->Range("A1:A1"); $worksheet->Hyperlinks->Add({ Anchor => $range, Address => "http://www.perl.com/"}); my $dir = cwd(); $workbook->SaveAs($dir . '/link.xls'); $workbook->Close;

    --
    John.