in reply to Win32:OLE UsedRange error 0x80020005: "Type mismatch"

I dunno. It all works just fine for me. (AS Perl, build 806)

In order to try to reproduce your error, I tried commenting out the use Win32::OLE::Const 'Microsoft Excel'; line. Indeed, that causes xlPrevious (etc.) to be undefined:

Bareword "xlPrevious" not allowed while "strict subs" in use...
which is not a "type mismatch" error as you say you got.

Then I tried removing strict, and that allowed an OLE error to occur, but again, not the same as the one you say you got:

Unable to get the Find property of the Range class

But the discrepancies may perhaps be due simply to version differences.

To eliminate one possible source of the error, I would look up the actual numeric values for those contants and use those.

Oh, here — I've done it for you:

xlPrevious = 2 xlByRows = 1 xlByColumns = 2
We're building the house of the future together.

Replies are listed 'Best First'.
Re^2: Win32:OLE UsedRange error 0x80020005: "Type mismatch"
by Anonymous Monk on Apr 04, 2006 at 11:55 UTC
    You are absolutely correct ... when I put in the values rather than the constants it works to a "tee" as one might say. Thankyou ... Thankyou ... Thankyou a true provider of perl wisdom.