use Win32::OLE::Variant;

my $excel = Win32::OLE->new('Excel.Application');

$excel->{'Visible'} = 0;

my $book = $excel->Workbooks->Open('c:\temp\r.xls');

my $sheet = $book->Worksheets(1);

my $cells = $sheet->Range("A1:F20")->{'Value'};

$book->Close;

$excel->Quit();

foreach my $a (@$cells) {

foreach my $b (@$a) {

print "$b\n";

}

}

The above PERL program extracts numbers from cells A1 to F20. Instead of the numbers in the cells, if worksheet #1 has the numbers in Text Box by Drawing in Rectangle, how should I do this in this PERL program? Thanks.


In reply to How to extract in Text Box from an Excel file with OLE in PERL? by jinhuang1992

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.