Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to comp.lang.perl.modules,comp.lang.perl.misc,microsoft.public.excel.misc,microsoft.public.excel.links,microsoft.public.excel.programming
-b -b is offline
external usenet poster
 
Posts: 1
Default Win32::OLE.pm and Hyperlinks

Paul Lalli wrote in message ...
On Thu, 22 Jul 2004, -b wrote:

I am using Perl and OLE.pm to read and modify an Excel spreadsheet.


I can read the hyperlinked value of a cell using the following code:

my $cellObject = $worksheet-Range("A2");
my $hyperlink = $cellObject-Hyperlinks(1)-Address;



Can anyone explain how to modify the value of an Excel cell's
hyperlink, or to add one to a cell if it has no hyperlink?


Disclaimer - I've never used this, nor tried to.

Based on MS's reference at:
http://msdn.microsoft.com/library/en...hyperlinks.asp

I would try:

$cellObject-Hyperlinks-Add(Range('A2'), 'http://www.msdn.com');

Paul Lalli


Thanks for the effort Paul, but that did not work. It threw an error:
"Undefined subroutine &main::Range called at line 58."

I changed the syntax around, but to no avail.
$cellObject-Hyperlinks-Add({Anchor=('D39'),Address='http://www.msdn.com'});
$cellObject-Hyperlinks-Add({Range=('D39'),Address='http://www.msdn.com'});
$cellObject-Hyperlinks-Add(Range=('D39'),Address='http://www.msdn.com');
Nothing seems to work.


I also tried the following structure, but that did not work either.

$worksheet-Range("D39")-Select();
$worksheet-Hyperlinks()-Add({ Address = "C:\\temp",
Anchor = Selected,
TextToDisplay = "Automated Link",
});

I also tried substituting 'Range("D39")' for the "Selected" value,
which did not work.

I've tried every variation I can think of, but have not been
successful yet.

-docuSwear
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Excel Error - Win32 exception Jahrzee Setting up and Configuration of Excel 0 May 28th 07 03:38 AM
Not a valid Win32 file ? davestanyon Setting up and Configuration of Excel 0 May 9th 05 05:54 PM
Win32 Registry function usage Steve James Excel Programming 0 February 18th 04 02:06 PM
Call Excel from VC++ Win32 DLL Julia[_2_] Excel Programming 0 December 11th 03 09:57 AM
Call Excel from VC++ Win32 DLL Julia[_2_] Excel Programming 0 December 8th 03 03:46 PM


All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"