Results 1 to 10 of 10

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

Threaded View

Bobbbo ".send" command creates an... 08-08-2023, 02:59 PM
Lastejp Re: ".send" command creates... 08-08-2023, 03:15 PM
Bobbbo Re: ".send" command creates... 08-08-2023, 03:35 PM
Lastejp Re: ".send" command creates... 08-08-2023, 04:23 PM
Bobbbo Re: ".send" command creates... 08-08-2023, 05:58 PM
Artik Re: ".send" command creates... 08-08-2023, 06:45 PM
Bobbbo Re: ".send" command creates... 08-09-2023, 11:02 AM
Lastejp Re: ".send" command creates... 08-09-2023, 11:31 AM
Bobbbo Re: ".send" command creates... 08-09-2023, 02:08 PM
Lastejp Re: ".send" command creates... 08-09-2023, 02:20 PM
  1. #1
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    405

    ".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.
    Set OutApp = CreateObject("Outlook.Application")
            OutApp.Session.Logon
            Set OutMail = OutApp.CreateItem(0)
            With OutMail
            
            .To = ActiveSheet.Range("Q59").Value
            .Cc = ActiveSheet.Range("Q60").Value
            .Subject = ActiveSheet.Range("Q61").Value
            .HTMLBody = ActiveSheet.Range("P62").Value & ",<br><br>" & _
             ActiveSheet.Range("P67").Value & _
             ActiveSheet.Range("R67").Value & "<br>" & _
             "<font color=""#FF0000""><strong><br>" & ActiveSheet.Range("P99").Value & "</font></strong><br><br>" & _
            "Regards," & "<br><br>" & "The " & ActiveSheet.Range("P19").Value & " Support Team<br><br>"
       
    
           .Attachments.Add pdfName
           .Attachments.Add ManualForm
    
            .HTMLBody = .HTMLBody & logo & vbCr & vbCr & vbCr & ManEntGoals
            
            .Send
            End With
    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.

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. 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