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

Re^2: Testing for Excel hyperlinks with Win32::OLE

by Albannach (Prior)
on Sep 27, 2005 at 17:32 UTC ( #495472=note: print w/ replies, xml ) Need Help??


in reply to Re: Testing for Excel hyperlinks with Win32::OLE
in thread Testing for Excel hyperlinks with Win32::OLE

It doesn't seem like quite the right approach, but I was able to locate the cell containing the hyperlink using $Sheet->Hyperlinks($_)->Range->Column and $Sheet->Hyperlinks($_)->Range->Row.

--
I'd like to be able to assign to an luser


Comment on Re^2: Testing for Excel hyperlinks with Win32::OLE
Select or Download Code
Re^3: Testing for Excel hyperlinks with Win32::OLE
by davidrw (Prior) on Sep 27, 2005 at 18:07 UTC
    Ah .. So you could do this at the beginning:
    my $cellsWithHyperlinks = {}; $cellsWithHyperlinks->{ $_->Column }->{ $_->Row }++ for map { $Sheet->Hyperlinks($_)->Range } 1 .. $Sheet->Hyperlinks->C +ount();
    And then while you're looping over the cells to write out the HTML:
    foreach my $col ( 1 .. 10 ){ warn "Col # $col has hyperlinks somewhere" if exists $cellsWithHyper +links->{$col}; foreach my $row ( 1 .. 10 ){ warn "(Col,Row)=($col,$row) has a hyperlink" if exists $cellsWithH +yperlinks->{$col}->{$row}; } }
      Excellent! I think this last bit of code will get me the rest of the way there. I had come across the idea of recording a macro and using it as a basis for my perl code, but had not tried it. The MS Office object model has been a real pain to parse for my overtired brain. Thanks for the help. You've both saved me much time and aggravation. Best, Sergej

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-07-04 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls