in reply to Win32::OLE and Excel
That way you can also trap common errors and act on them, also.$obj=Win32::OLE->GetObject("IIS://localhost/W3SVC/1"); &OLEErrChk("Binding to W3SVC1",1)
Hope that helps, Vladsub OLEErrChk { my $operation=shift; my $critical=shift; my $errnum=Win32::OLE->LastError; if(!$errnum) { if ($errnum=~/0x80070094/) { print "$operation Failed (in use) trying something..\n"; &Something; } else { print "$operation Failed: $errnum\n"; die if ($critical); } } else {print "$operation was Successful.\n"} }
|
|---|