+ Reply to Thread
Results 1 to 10 of 10

".send" command creates an error on one computer but not another

  1. #1
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    ".send" command creates an error on one computer but not another

    I have VBA code that has been working flawlessly for year. Now all of a sudden I am getting an error:
    send error code.PNG
    Run-Time error '-2147467259 (80004005)':

    Outlook does not recognize one or more names.

    When I select debug, .send is highlighted. I put the same workbook on another computer and everything runs fine with no errors.
    Please Login or Register  to view this content.
    Any Ideas!!!

    EDIT: I found a solution that does not make sense, but it works. By simply adding .Display a line before .Send the VBA code does not fail. I was thinking it might be a speed issue where the VBA code is runing too fast. So I added a delay statement just before the .Send. I added: Application.Wait Now + TimeSerial(0, 0, 5) which delays the running of the VBA code by 5 seconds. But it still fails when it reaches .Send. The one thing I find interesting is that I use the .Send command about 3 times to send emails to specific people, but they don't fail.

    I don't feel comfortable with the .Display command fixing the issue. Any one know why that works.
    Last edited by Bobbbo; 08-09-2023 at 02:05 PM.

  2. #2
    Registered User
    Join Date
    07-26-2023
    Location
    Oklahoma
    MS-Off Ver
    365
    Posts
    57

    Re: ".send" command creates an error on one computer but not another

    Does the other computer have Outlook (I would think so) and an account that is logged in?

  3. #3
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: ".send" command creates an error on one computer but not another

    Quote Originally Posted by Lastejp View Post
    Does the other computer have Outlook (I would think so) and an account that is logged in?
    Yes they are identical Outlook accounts. I also have looked into the two Outlook setting to make sure they are the same and they are.

  4. #4
    Registered User
    Join Date
    07-26-2023
    Location
    Oklahoma
    MS-Off Ver
    365
    Posts
    57

    Re: ".send" command creates an error on one computer but not another

    What is "logo"?

    May need to see more of that code to get a better idea of what may be happening. Perhaps you are accessing something that is specific to a ...AppData\Roaming\... file

  5. #5
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: ".send" command creates an error on one computer but not another

    logo is a graphic on the email. I commented that line of code out as well as the attachments and it still fails. The complete VBA code is thousands of line long.

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: ".send" command creates an error on one computer but not another

    Do cells Q59 and Q60 contain email addresses, such as [email protected], or display names, such as "John Doe". If the latter, you probably don't have that addressee in your contacts.

    Artik

  7. #7
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: ".send" command creates an error on one computer but not another

    Artik, Those cells are full email addresses like [email protected].

  8. #8
    Registered User
    Join Date
    07-26-2023
    Location
    Oklahoma
    MS-Off Ver
    365
    Posts
    57

    Re: ".send" command creates an error on one computer but not another

    Just a thought. I always put the following code in before sending:

    Please Login or Register  to view this content.
    You might also put in
    Please Login or Register  to view this content.
    and stop there to see the email before sending...

  9. #9
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: ".send" command creates an error on one computer but not another

    Quote Originally Posted by Lastejp View Post
    Just a thought. I always put the following code in before sending:

    Please Login or Register  to view this content.
    You might also put in
    Please Login or Register  to view this content.
    and stop there to see the email before sending...
    Thanks Lastejp. I tried adding the .Display before the .Send before you responded and it worked. I edited my original question. Why does this work?

  10. #10
    Registered User
    Join Date
    07-26-2023
    Location
    Oklahoma
    MS-Off Ver
    365
    Posts
    57

    Re: ".send" command creates an error on one computer but not another

    I think it's a matter of timing. The VBA code is trying to send the email before Outlook has resolved the addresses. That's why I always use .Recipients.ResolveAll and DoEvents first

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Identical VBA Code works on computer A, throws error on computer B???
    By PWM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2018, 08:15 AM
  2. VBA button to send command to serial port to get data and send to Excel
    By reiiling in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2017, 07:13 AM
  3. Replies: 0
    Last Post: 11-06-2013, 04:37 PM
  4. How to select a picture from computer through UserForm & Send it to Sheet1.
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2013, 03:20 PM
  5. Vba in Excel 2007 to copy a pdf from computer to ftp, using FileCopy command
    By dbocz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 06:32 PM
  6. Macro does not Send email from a Computer
    By nikuexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2011, 04:07 PM
  7. [SOLVED] using filer command in excell it locks up my computer
    By Larry King in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-29-2006, 10:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1