Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Trapping errors with Win32::OLE

by cr_ashok (Novice)
on Dec 06, 2004 at 07:32 UTC ( [id://412599]=perlquestion: print w/replies, xml ) Need Help??

cr_ashok has asked for the wisdom of the Perl Monks concerning the following question:

I am using Win32:OLE in perl script, to add and retrieve data from excel sheet. How to catch/trap the error message using perl, displayed by Microsoft. Please help

2004-12-06 Edited by Arunbear: Changed title from 'Win32OLE help', as per Monastery guidelines

Replies are listed 'Best First'.
Re: Trapping errors with Win32::OLE
by EverLast (Scribe) on Dec 06, 2004 at 08:57 UTC
    Notice that you have to explicitly indicate that you want to catch errors:

    # 2 = Throw errors, allowing script to deal with it. # 3 = Die on errors $Win32::OLE::Warn = 2;

    ---Lars

Re: Trapping errors with Win32::OLE
by maa (Pilgrim) on Dec 06, 2004 at 07:47 UTC

    Doesn't Win32::OLE->LastError do what you need?

    HTH - Mark

Re: Trapping errors with Win32::OLE
by Grygonos (Chaplain) on Dec 06, 2004 at 16:58 UTC
    Also make sure the DisplayAlerts property of the Application object is set

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://412599]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found