Note that there are some explanatory texts on larger screens.

plurals
  1. POExcel 2010 VBA .send error
    primarykey
    data
    text
    <p>I have the following code, which works FINE for 10 macros prior to this one (I use a call x, call Y macro), but this one does not want to work.</p> <pre><code>Sub Send_Tips() Application.DisplayAlerts = False Dim Email_Subject, Email_Send_From, Email_Body As String, i As Integer Dim Mail_Object, nameList As String, o As Variant Email_Send_From = "" For i = 1 To 1 'use cells 1 to 1 in column "A" where names are stored If Sheets("Tips").Range("A1").Value &lt;&gt; "" Then nameList = nameList &amp; ";" &amp; Sheets("Tips").Range("A" &amp; i).Value End If Next Set Mail_Object = CreateObject("Outlook.Application") With Mail_Object.CreateItem(o) .Subject = "Dealer Action Plans" .To = nameList .Body = "Please find attached the latest version of the Dealer Action Plans." 'Make a copy of the active sheet and save it to 'a temporary file Worksheets("Tips").Activate ActiveSheet.Copy Set wb = ActiveWorkbook Filename = "Tips.pdf" Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Worksheets("Tips").ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:="c:\aaaWork\Tips.pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False ' ActiveWorkbook.SaveAs Filename:="C:\aaaWork\NC1.PDF", FileFormat:=17 .Attachments.Add "C:\aaaWork\Tips.PDF" .send 'Will send straight away use .display to send manually ActiveWorkbook.Close Saved = True Kill "C:\aaaWork\Tips.PDF" End With Application.DisplayAlerts = True End Sub </code></pre> <p>I get the following error message when the line .send 'Will send straight away use .display to send manually is ran. Run Time Error '2147467259 (80004005)': Outlook doesn't recognise one or more names</p> <p>The sheet name Tips does exist, any ideas?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload