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