in reply to Re^2: WIn32::OLE debug
in thread WIn32::OLE debug

Method calls are not interpolated in double quoted strings. Therefore,
print "table rows count= $table->Rows->Count \n";

only interpolates $table. Instead, try

print 'table rows count = ', $table->Rows->Count, ".\n";

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: WIn32::OLE debug
by chafelix (Acolyte) on Oct 12, 2025 at 18:56 UTC
    Then
    print "table rows count=", $table->Rows->Count ,".\n"; # prints 23 foreach my $rownum (1 .. $table->Rows->Count) { print "rownum=$rownum\n"; #prints 1 my $row = $table->Rows->Item($rownum); #crashes!

    OLE exception from "Microsoft Word": ?e? e??a? d??at? ? p??s▀as? ╡e╡???╡???? ??a╡╡?? se a?t?? t? s??????, epe?d? ? p??a?a? ??e? s?????e?╡??a ?e??? ?ata????fa. Win32::OLE(0.1712) error 0x800a1767 in METHOD/PROPERTYGET "Item" at parserworks16.pl line 191.

    is there a way to look at the elements of the $table->Rows object? It would appear that this does not have an Item(1) element
      PMFJI, but shouldn't
      my $row = $table->Rows->Item($rownum); #crashes!
      be more something like
      my $row = $table->Rows($rownum)->Item; # probably also crashes, but di +fferently ;-)
      ?
        Nope, same error

        numrows=23

        table rows count=23.

        rownum=1 OLE exception from "Microsoft Word":

        ?e? e??a? d??at? ? p??s▀as? ╡e╡???╡???? ??a╡╡?? se a?t?? t? s??????, epe?d? ? p??a?a? ??e? s?????e?╡??a ?e??? ?ata????fa.

        Win32::OLE(0.1712) error 0x800a1767 in METHOD/PROPERTYGET "Rows" at parserworks16.pl line 191.