Runtime Error 429 when getting Access to check/run Outlook

snakie

Registered User.
Local time
Today, 20:32
Joined
Jun 18, 2009
Messages
14
Hello,

Part of my database contains procedures of automatically send emails. I notice that if Outlook is not running already, Access displays an error.

Therefore, I am now trying to get Access to check if Outlook is already running, and if not, run Outlook.

Unfortunately, I receive a Runtime Error 429 - Active component can't create object.

Here's the script:

Code:
    Dim appOutlook As Object
    On Error GoTo Err_EmailRptOverDoc_Click
    Set appOutlook = GetObject(, "Outlook.Application")
    If TypeName(appOutlook) = "Nothing" Then
        Set appOutlook = CreateObject("Outlook.Application")
    End If


Could someone points me to the right direction on why this is the case? I've been searching on the internet for a while but unable to find a solution.

Many thanks in advance.

Joe
 
some of this stuff i really don't understand, but why are you using GET OBJECT? it needs to be created first, doesn't it? also, are you killing the object out of memory when the procedure is run.

many a time i screw up royally because a bug stopps by code from running hallf way through the procedure when i have already created an ol object. therefore, the memory is already there...then when i run it again, it creates another ol object, and so forth. so...in the TM, you end up seeing 5 lines under the "processes" tab that says MS outLook. could this be related? here is the code that i usually use for sending dynamic mail:
PHP:
dim ol as object
set ol = createobject("outlook.application")

GO ON FROM HERE...
 
Hi and thanks for this. I can do a CreateObject if Outlook is not running or not already in the system memory. However, if Outlook is already running, a Runtime error 462 (the remote server machine does not exist or is unavailable).

As a result, I am hoping to get Access to check and see if Outlook is already running, and only if Outlook is not running that Access can execute the CreateObject line.

Would that be possible?

Thanks in advance.

Joe
 
Hi and thanks for this. I can do a CreateObject if Outlook is not running or not already in the system memory. However, if Outlook is already running, a Runtime error 462 (the remote server machine does not exist or is unavailable).

As a result, I am hoping to get Access to check and see if Outlook is already running, and only if Outlook is not running that Access can execute the CreateObject line.

Would that be possible?

Thanks in advance.

Joe

in the past i've used programs like UNIBLUE'S task manager to check for this type of junk going on, but i would guess your best best would be to use the KILL statement in VBA to kill the ol process even if it's not running or not...and if by chance it's not, it wouldn't hurt anything, because at the beginning of hte procedure you write: ON ERROR RESUME NEXT. that's pretty much guarantee you to rid your machine of any running outlooks.
 
in the past i've used programs like UNIBLUE'S task manager to check for this type of junk going on, but i would guess your best best would be to use the KILL statement in VBA to kill the ol process even if it's not running or not...and if by chance it's not, it wouldn't hurt anything, because at the beginning of hte procedure you write: ON ERROR RESUME NEXT. that's pretty much guarantee you to rid your machine of any running outlooks.

Hmmm I'll see what I can do... It's so weired I can't use GetObject and CreateObject at the same time. Initially I thought it would be so straight forward... GetObject on Outlook, if failed, CreateObject. This is like a totally different world to me.. :confused:
 

Users who are viewing this thread

Back
Top Bottom