joyacv2
asked on
error 429 Cannot create Outlook object
Hi,
This code work perfect, but now for some reason i get an error 429, Cannot create outlook object. I try to find an answer, but i never found. It's like a dll or registry problem, any Idea?
This code work perfect, but now for some reason i get an error 429, Cannot create outlook object. I try to find an answer, but i never found. It's like a dll or registry problem, any Idea?
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.GetOutlook()
Me.SendMessage()
End Sub
' Declare module level variables
Dim mOutlookApp As Microsoft.Office.Interop.Outlook.Application
Dim mNameSpace As Microsoft.Office.Interop.Outlook.NameSpace
Dim mFolder As Microsoft.Office.Interop.Outlook.MAPIFolder
Dim mItem As Microsoft.Office.Interop.Outlook.MailItem
Dim fSuccess As Boolean
' Module contains only 2 methods:
' 1) GetOutlook()
' 2) SendMessage()
''
Public Function GetOutlook() As Boolean
' The GetOutlook() function sets the Outlook Application
' and Namespase objects and opens MS Outlook
On Error Resume Next
' Assume success
fSuccess = True
mOutlookApp = GetObject("", "Outlook.aplication")
' If Outlook is NOT Open, then there will be an error.
' Attempt to open Outlook
If Err.Number > 0 Then
Err.Clear()
mOutlookApp = CreateObject("Outlook.aplication")
If Err.Number > 0 Then
MsgBox(Err.Number)
MsgBox("Could not create Outlook object", vbCritical)
fSuccess = False
Exit Function
End If
End If
' If we've made it this far, we have an Outlook App Object
' Now, set the NameSpace object to MAPI Namespace
mNameSpace = mOutlookApp.GetNamespace("MAPI")
If Err.Number > 0 Then
MsgBox("Could not create NameSpace object", vbCritical)
fSuccess = False
Exit Function
End If
' Return the Success Flag as the value of GetOutlook()
GetOutlook = fSuccess
Which version of Outlook?
ASKER
hi,
Outlook 2007
Outlook 2007
Did it stop working when you upgraded to 2007 or have you had it working with 2007?
ASKER
Hi,
The problems occurs suddenly. This code works perfect, maybe i change something during adapting with my program. But I wrote the original code again and the problem appears. I really think that something happens in the registry during the modification. Any idea?
The problems occurs suddenly. This code works perfect, maybe i change something during adapting with my program. But I wrote the original code again and the problem appears. I really think that something happens in the registry during the modification. Any idea?
ASKER
Hi,
One of the changed line was the Outlook.aplication, by error. But i correct that. Maybe here is the problem. This cause something crazy when try to run the code. After that the code, sends this 429 error.
One of the changed line was the Outlook.aplication, by error. But i correct that. Maybe here is the problem. This cause something crazy when try to run the code. After that the code, sends this 429 error.
ASKER
Hi,
I check this site and did step by step and the problem continues.
I check this site and did step by step and the problem continues.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The word "application" is misspelled as "aplication" on lines 25 and 32. Correct the spelling and the code should work.
ASKER
Thank You! This solve my problem!