gongcw:

OK, I now understand what you want. It's not really a perl question at all--it's more of an Excel question. As I understand it, you want to be able to ask excel for the list of pictures in a sheet so you can move them to your word document.

I poked around and found a reference to Excel's object model and briefly looked around in it to find the appropriate collection to use. Unfortunately, I didn't find one explicitly for pictures. However, the OLEObjects collection page shows an example of adding a bitmap to a sheet. So you should be able to access the images through the OLEObjects collection.

The problem is that the OLEObjects collection might contain many odd things in it, and unless you know what the object is, you'll find it difficult to work with. In the OLEObjects collection example, though, it shows adding a gif image like this:

Worksheets(1).OLEObjects.Add FileName:="arcade.gif"

So if you iterate over the OLEObjects and check the FileName property of each object, you might find one with a .BMP extension. Be aware that many objects might not have a FileName property, so when you're checking, don't kill your application just because the FileName property doesn't exist.

If you can determine the OLEObject type of the objects you're interested in, then you'll be able to find more information via google on how to communicate with them. Dig through the Excel Object reference (link above) and you may find some good clues. Failing that, I'd post a question on an Excel guru board.

...roboticus


In reply to Re^5: How to get picture in MS excel and insert them into MS word file by the module win32::OLE? by roboticus
in thread How to get picture in MS excel and insert them into MS word file by the module win32::OLE? by gongcw

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.