Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
"be consistent"
 
PerlMonks  

Trapping errors with Win32::OLE

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

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 maa (Pilgrim) on Dec 06, 2004 at 02:47 UTC

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

    HTH - Mark

Re: Trapping errors with Win32::OLE
by EverLast (Scribe) on Dec 06, 2004 at 03: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 Grygonos (Chaplain) on Dec 06, 2004 at 11: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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.