Sign in to follow this  
Followers 0
water

Wait until "COM environment" is ready

5 posts in this topic

#1 ·  Posted (edited)

Wooltown and I "brush up" the Outlook UDF.

Now I've noticed a strange difference between Outlook 2002 (the one running in my office till a few days ago) and Outlook 2010 (the one running now in my office on Windows 7).

If I opened Outlook using ObjCreate when Outlook wasn't running yet and immediately accessed a property in Outlook 2002 it was working fine.

With Outlook 2010 I get Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)). If I Sleep() for a few seconds everything works fine again.

So I get the impression that Outlook now does some of its startup asynchroniously. I've searched the internet high and low but couldn't find a single hint.

Am I doing something wrong? Is there a way to check if Outlook has finished starting up so the "COM environment" is ready to use?

Thanks for any support!

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites



Is there a way to check if Outlook has finished starting up so the "COM environment" is ready to use?

Use the com error handler functionality to trap the error until it no longer appears.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Use the com error handler functionality to trap the error until it no longer appears.

Thanks for the reply! That's what I was thinking of as well - but I hoped there was a more "elegant" method :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Blame Microsoft. That was a pretty poor design decision to load a library asynchronously.

Share this post


Link to post
Share on other sites

OK, I'm going to blame M$ :)

Do you think they will then solve the problem :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0