Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2013
    Posts
    24

    Unanswered: Error 429 when sending email from Access 2010

    Hi all,

    I have some code on a form in Access which (when a button is clicked) sends an email with the details of the new record (just entered) via Outlook.

    The problem is that 1 of the machines I need this to run on comes up with an "error 429" when it tries to create the email.

    I have created this form/code in Access 2007 but the users all have different versions of office.

    So far I have got it working on machines with Win 8/Office 2013, Win 7/Office 2010 & Win XP/Office 2007 all using the same code.

    The machine I'm having a problem with is running Office 2010 on Win 7 and comes up with the error:
    Code:
    ActiveX component can't create object or return reference to this object (Error 429)
    The line highlighted when debugging this error is:
    Code:
    Set olApp = CreateObject("Outlook.Application")
    All the references selected are present and the same as another machine with the same Win/Office setup (which is working fine).
    One solution I found when searching online was to select the "DAO 3.6 library" unfortunately when I tried that it told me that a reference with that name was already selected (which it isn't).

    Below is my code for the button press (the Str variables are strings created elsewhere in the code):
    Code:
    Private Sub CmdSaveSend_Click()
    Dim olApp As Outlook.Application
    
    Dim olNS As Outlook.Namespace
    Dim olFolder As Outlook.MAPIFolder
    
    Dim olMailItem As Outlook.MailItem
    
    Set olApp = CreateObject("Outlook.Application")
    Set olNS = olApp.GetNamespace("MAPI")
    Set olFolder = olNS.GetDefaultFolder(olFolderInbox)
    Set olMailItem = olFolder.Items.Add("IPM.Note")
    
    StrBodyText = "Enquiry No: " & StrEnquiryNo & vbCrLf & _
        "Date: " & StrDate & " Time: " & StrTime & vbCrLf & _
        "Name: " & StrTitle & " " & StrFName & " " & StrSName & vbCrLf & _
        "Address: " & StrAddress & vbCrLf & _
        "Post Code: " & StrPostCode & vbCrLf & _
        "Email: " & StrEmail & vbCrLf & _
        "Daytime Tel: " & StrDayTel & vbCrLf & _
        "Evening Tel: " & StrEveTel & vbCrLf & _
        "Taken By: " & StrTakenBy & vbCrLf & _
        "Lead Source: " & StrLeadSource & vbCrLf & _
        "Comments: " & StrComments
    
    With olMailItem
        .Subject = "Enquiry No: " & StrEnquiryNo
        .To = "email address omitted"
        .Body = StrBodyText
    '    .Importance = olImportanceHigh
    '    .FlagStatus = olFlagMarked
    '    .FlagDueBy = Date + 2
    '    .Display
        .Send
    End With
    
    Set olMailItem = Nothing
    Set olFolder = Nothing
    Set olNS = Nothing
    Set olApp = Nothing
        
    MsgBox ("Thank You, your lead has been saved and emailed")
    End Sub
    Any help would be greatly appreciated.

    Thanks,
    Gav
    Last edited by Gadgetgav; 08-02-13 at 06:53.

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    Is this line not causing an error on the other machines? Then check you references and see if your missing a reference to Outlook.

  3. #3
    Join Date
    Apr 2013
    Posts
    24
    Quote Originally Posted by Burrina View Post
    Is this line not causing an error on the other machines? Then check you references and see if your missing a reference to Outlook.
    No this line isn't causing an error on any other machine, including another PC with the same setup (Win 7/Office 2010).

    I've checked the references and they match the other machine (including the Outlook reference) the only one that isn't selected (that according to Google might be needed) is the DAO 3.6 library but this brings up an error when I try selecting it saying that there is already a reference of that name selected.

    Any ideas?
    Is there a permissions setting that I don't know about in Outlook or Windows that needs to be changed?

    Thanks,
    Gav

  4. #4
    Join Date
    Nov 2011
    Posts
    413
    According to what I have checked about this error, it has something to do with ActiveX
    Is this a split db? Do you have another copy to check on this pc?

  5. #5
    Join Date
    Apr 2013
    Posts
    24
    Quote Originally Posted by Burrina View Post
    According to what I have checked about this error, it has something to do with ActiveX
    Is this a split db? Do you have another copy to check on this pc?
    Yeah I found mentions of ActiveX as well but it won't let me select the library that all the Google search results suggest will solve the issue.

    It is a split DB with several front ends (all the same apart from the MS Office libraries as they have different versions of Office) all running off the same back end. I have tried several of these front ends and they all do the same thing.

  6. #6
    Join Date
    Nov 2011
    Posts
    413
    Do you know what forms,etc.. require ActiveX ? Is there code in a specific module that calls for it? Was the db working before and is so when? Try and remember when any changes were made. Does the db compile without any errors? If not, what are they! Slowly try different things to eliminate the problem.

  7. #7
    Join Date
    Apr 2013
    Posts
    24
    Quote Originally Posted by Burrina View Post
    Do you know what forms,etc.. require ActiveX ? Is there code in a specific module that calls for it? Was the db working before and is so when? Try and remember when any changes were made. Does the db compile without any errors? If not, what are they! Slowly try different things to eliminate the problem.
    I haven't worked with Access or Outlook much in the past (I mainly work with Excel which is where I get my VBA knowledge from) so I'm not completely sure which bit requires ActiveX (other than the create Outlook object line previously mentioned).

    As I mentioned I have multiple users using this DB all on different versions of Win/Office I only get limited access to some of the machines as the users need them all day (this being one of them) so I have only just started trying to run this on this PC.

    All of the code works on this machine to do everything except link to Outlook to send the email (this has always been the case on this PC as far as I can recall) and on all the other PCs everything works fine.

    I'm not sure what you mean by "compile" (like I said I don't have much experience with DBs) please explain this for me.

    Thanks,
    Gav

  8. #8
    Join Date
    Nov 2011
    Posts
    413
    Open the db in design mode, holding down the shift key when opening. Then open a form and then click on any event procedures associated with the form and then click on Database Tools and then Compact/Repair and see if any errors show up.

  9. #9
    Join Date
    Apr 2013
    Posts
    24
    Ok, wierdly when I came on this morning I tried running it again to see what happened and the error changed to a different part of the Outlook send code.

    After doing a bit more research I found this code:
    Code:
    DoCmd.SendObject , , , "email omitted", , "email omitted", "Test", StrBodyText, 0
    This is now giving me:
    Code:
    run-time error '2296': The password is invalid, the message wasn't sent
    even though there's been no mention of a password

    Any ideas?

    Thanks,
    Gav

  10. #10
    Join Date
    Nov 2011
    Posts
    413
    Did you try and compile? Any errors? It appears to be a missing dll file. Suggest you visit this site and run the downloaded file. How to Fix Runtime error 2296

  11. #11
    Join Date
    Apr 2013
    Posts
    24
    Quote Originally Posted by Burrina View Post
    Did you try and compile? Any errors? It appears to be a missing dll file. Suggest you visit this site and run the downloaded file. How to Fix Runtime error 2296
    I've now compiled the DB and not had any errors show up (would they appear as a message or do I need to look somewhere for them?)

    I'm a bit apprehensive about downloading anything from a site I don't know.
    Is it definitely safe? And is it it likely to solve the problem? My boss is pretty strict about what gets installed/downloaded

    I can't actually download anything at all at the moment because our Internet is down (I'm writing this from my phone) so I don't know when I'll be able to run any more tests
    Last edited by Gadgetgav; 08-15-13 at 07:35.

  12. #12
    Join Date
    Nov 2011
    Posts
    413
    Up to you about the site. I can't make any guarantees either way.If there were any errors when compiling, they would have show up. Do what you think is best to fix the .dll problem.Do some research yourself and check your db references. Good Luck!

  13. #13
    Join Date
    Apr 2013
    Posts
    24
    Ok, thanks very much for your help so far

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •