in reply to Re^4: problem with script transfered from VBS
in thread problem with script transfered from VBS

Hi ,

Although the you didn't get a compile-time error, you may have experienced a run-time error - which wasn't caught.

If it's the basic Win32::OLE module, any error from the last operation can be accessed via a call to Win32::OLE->LastError(), so try ...

$rs->Fields('AEName')->value($psProxyName); die "value(\$psProxyName) failed - " . Win32::OLE->LastError() if Win3 +2::OLE->LastError();

BTW, my sig is self-deprecating - it says that PM has a higher regard for my experience than I do;-)

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^6: problem with script transfered from VBS
by xiaoyafeng (Deacon) on Aug 07, 2008 at 03:30 UTC
    It throws:
    C:\>perl cmp2.pl value($psProxyName) failed - Win32::OLE(0.1709) error 0x8002000e: "Inv +alid numbe r of parameters" in METHOD/PROPERTYGET "Value"Meter proxy created having the ID: Script Finished
    What does it mean? and how do I walk around? Thanks in advance!

    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
      Hi ,

      You gave value() one parameter - $psProxyName - the library was clearly expecting either more or less than that...if more, of what form they take I have no idea.

      It could, of course, be that the OLE model is similar to the Excel OLE model, in which case, value() is an accessor method, taking no args, to return the current value...and if that's so, then you could possibly (last throw of the dice time) try replacing $rs->Fields('AEName')->value($psProxyName); with $rs->Fields('AEName')->{value} = $psProxyName; - note the change of value() to {value} i.e. from method invocation to hash member.

      Other than that, I think you need to look at the COM model for your application for further information...Node Using Win32::OLE and Excel - Tips and Tricks gives an excellent overview of the use of Win32::OLE with Excel - from whence I 'borrowed' the above last ditch attempt to help.

      A user level that continues to overstate my experience :-))
        Thanks for your tireless reply!
        After I study it a whole day, I decided to give it up and turn to use DBI.( although it raised new problem :()
        Anyway, Thank you for your kindly help!

        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
      How can "Invalid number of parameters" be ambiguous?