Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

CreateObject does not create an Outlook Instance Under Access 2010

Avatar of John Clingeleffer
John ClingelefferFlag for Australia asked on
Microsoft Access
30 Comments1 Solution974 ViewsLast Modified:
I have an Access 2003 application that uses the Outlook Object Model to send out e-mails. The following code runs fine under Access 2003, but does not open an instance of Outlook 2010 when executed under Windows 7/Access 2010. Err returned from Set objOL = GetObject(, "Outlook.Application") is 429

'code to start outlook
 Dim outlookForceStarted As Boolean
 Dim objOL As Outlook.Application
 Dim oItem As Outlook.MailItem
 outlookForceStarted = False

'set error handling to resume next as GetObject will generate an error if
'Outlook is not running
On Error Resume Next

'see if Outlook is running
errMsg = "Error checking if Microsoft Outlook is running."
Set objOL = GetObject(, "Outlook.Application")
'non zero error indicates Outlook is not running so start it
If Err <> 0 Then
    'Outlook wasn't running, so start it
     errMsg = "Error starting Microsoft Outlook."
     Set objOL = CreateObject("Outlook.Application")
     outlookForceStarted = True
End If

'change following line to reflect the error handling routine of the function/sub
'that this code is being pasted into
On Error GoTo PrintErrorBit
ASKER CERTIFIED SOLUTION
Avatar of Chris Bottomley
Commented:
This problem has been solved!
Unlock 1 Answer and 30 Comments.
See Answers