saltire1963
Board Regular
- Joined
- Aug 11, 2014
- Messages
- 69
Tried researching this error I get when running my file, it says "Object doesn't support this property or method", however it doesn't point to which object is causing the issue. I am basically trying to populate an Outlook e-mail with e-mail addresses that I loop through in Column A .
VBA Code:
Dim EmailApp As Outlook.Application 'To refer to outlook application
Dim EmailItem As Outlook.MailItem 'To refer new outlook email
Dim EmailAddr As String
Dim LastRow As Long
Dim cell As Range
Application.EnableEvents = False
Application.ScreenUpdating = False
Set EmailApp = New Outlook.Application 'To launch outlook application
Set EmailItem = EmailApp.CreateItem(olMailItem) 'To launch new outlook email
'Find last row in Column A
LastRow = Sheets("Players").Cells(Rows.Count, 1).End(xlUp).Row
Set cell = Range("A1:A" & LastRow)
With Sheets("Players")
For Each cell In Range("A1:A" & LastRow)
If cell.Value Like "*@*" Then
EmailAddr = EmailAddr & ";" & cell.Value
End If
Next
End With
With Sheets("Players")
.Attachments.Add ActiveWorkbook.FullName, , , ActiveWorkbook.Name
.Display
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
Last edited by a moderator: