Hi, I'm writing a general utility (distributed as a PAR app) that converts an Excel spreadsheet to an HTML table without the gastly formatting that Excel's export feature uses. I'm using Win32::OLE.

I'm missing one piece of the puzzle. As I parse the spreadsheet, how do I test for the presence in a hyperlink in a given cell so I can grab the url via the hyperlink object when I've found one? I'd like to avoid the user having to specify in advance which columns have hyperlinks, especially since they may not be so simply organized.

I've reviewed everything I could find in the archives. Of special interest to others might be Using Win32::OLE and Excel - Tips and Tricks and an excellent summary of nodes at Index of Spreadsheet FAQs. All the examples I've come across refer to parsing links when you know you have one.

Is there a cleaner solution than trying to access a hyperlink object in each cell and skipping those that throw an exception on the attempt?

Thanks, Sergej

In reply to Testing for Excel hyperlinks with Win32::OLE by sz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.