Page 1 of 1

OLE Errors

Posted: Thu Aug 15, 2024 9:47 pm
by byron.hopp
My most popular error is involving OLE. See the error below:

Error occurred at: 08/15/24, 14:42:21
Error description: Error TOleAuto/-1 0x80080005: TOLEAUTO:NEW
Args:
[ 1] = C Outlook.Application
[ 2] = U
[ 3] = U

How can I check to eliminate this before it happens?

Thanks,

Re: OLE Errors

Posted: Fri Aug 16, 2024 2:46 am
by Lailton
Can you try it?

Code: Select all | Expand

try
    oOutlook := CREATEOBJECT("Outlook.Application")
catch
    oOutlook := nil
end

if hb_isObject( oOutlook )
    ? "ok"
else
    ? "err"
endif

 
:D

Re: OLE Errors

Posted: Fri Aug 16, 2024 4:49 am
by byron.hopp
Yes I will, Thanks,

Re: OLE Errors

Posted: Fri Aug 16, 2024 4:24 pm
by byron.hopp
Why does it throw an error on the CreateObject line, is there a way to identify that?
If it does throw an error, what needs to be done to make it successful the next time?

Re: OLE Errors

Posted: Fri Aug 16, 2024 4:40 pm
by karinha

Code: Select all | Expand

   TRY

      oOutLook := GetActiveObject( "Outlook.Application" )

   CATCH

      TRY

         oOutLook := CREATEOBJECT("Outlook.Application")

      CATCH

         MsgInfo( "Outlook Is Not Available" )

         RETURN( .F. )

      END

   END

   // .AND. .OR.
   IF FWGetOleObject( "outlook.application" ) == nil

      MsgInfo( "Outlook Is Not Available" )

      RETURN NIL

   ELSE

      MsgInfo( "outlook is available" )

   ENDIF
 
Regards, saludos.

Re: OLE Errors

Posted: Fri Aug 16, 2024 4:55 pm
by byron.hopp
This is the code I am currently using:

Function GetOutlookObject()
// Same functionality of VBA's GetObject()
Local oOutlook := nil
Try
oOutlook := GetActiveObject("Outlook.Application")
Catch
oOutlook := CreateObject("Outlook.Application")
End
Return oOutlook

My question is why is outlook not available, if this doesn't work, what do I tell the user to do to correct the issue?

Thanks,

Re: OLE Errors

Posted: Fri Aug 16, 2024 5:02 pm
by Antonio Linares
You may tell the user to check if Outlook is installed on his pc

Re: OLE Errors

Posted: Fri Aug 16, 2024 5:21 pm
by byron.hopp
Yes, this is the same PC every day, Outlook has been installed ever since the workstation was setup at the users desk. Typically outlook is running. I just don't have enough information to even begin to think why it is not working. Assuming that it is installed (and hopefully that nobody has uninstalled it), is there any kind of test that can be performed before I try GetActiveObject or CreateObject to insure success? By the way, it works most of the time, my error system using Outlook to send me an email with a copy of the error, after it gets the error on the try and throw's an error, the error system is able to open outlook and send the error message to me. I just don't know why it didn't work on the first try at the start of this whole process.

Re: OLE Errors

Posted: Fri Aug 16, 2024 7:11 pm
by karinha
Is outlook set as the DEFAULT E MAIL SENDER? Manually, is it sending correctly?

Regards, saludos.

Re: OLE Errors

Posted: Sat Aug 17, 2024 4:46 am
by Jimmy
hi,

i would re-Install Outlook when get OLE Error.

Re: OLE Errors

Posted: Sun Aug 18, 2024 8:31 am
by driessen
Hello everyone,

So now or then, I experience OLE-errors after an update of Microsoft 365 has been installed.

The problem usually disappears when I perform a small repair of Microsoft 365.