First, I would make sure that you can do this manually in Excel. If you can't, I'm not sure how to help you get Win32::OLE to do it. (By the way, I believe that I have seen this before Excel spreadsheets, so I think it is possible.)

Secondly, I would try to look at the OLE browser that is part of the Win32::OLE module and look specifically at the Excel library. Given that I don't have a good Basic/VB background, I admit that it's about like reading Greek for me.

Third, try to record a macros to do what you want and then look at its source code. I don't translate the VB to Perl line by line, but it should give you an idea what needs to be done. (For example, I usually ignore the select and activation lines.)

I'm out of town right now without a system that has both Excel and Perl, so I can't try testing/creating codes to help you right now. If I don't get swamped with other things, I'll try to look at this again in a few days and post some suggested code, but I make no promises. In the mean time, I hope that this information might help you down the right path to finding a solution.


In reply to Re: Win32::Ole excel external data range by dasgar
in thread Win32::Ole excel external data range by anti-monk

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.