Hello,
Could you please help me?
I would like to delete sheet where it contain all the emails which should be use in my VBA.
To do it, I wrote all emails inside of VBA.
Example:
Sub email ()
Dim OutApp As Object
Dim OutMail As Object
To_Austria = "xxxx@gmail.com";"yyyyy@gmail.com;"
CC_Austria= "xxxx@gmail.com";"yyyyy@gmail.com;"
To_Belgium = "xxxx@gmail.com";"yyyyy@gmail.com;"
CC_Belgium= "xxxx@gmail.com";"yyyyy@gmail.com;"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "To_" & Sheet8.Cells(4, 3)
.CC = "CC_" & Sheet8.Cells(4, 3)
.BCC = ""
.Subject =""
.Body =
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
The sheet Sheet8.Cells(4, 3) is the country which appear in the file and it can be changed manually.
When I run the macro, outlook show the text "To_Austria" and "CC_Austria" instead of emails. How could I make the VBA to take email?
regards,
Could you please help me?
I would like to delete sheet where it contain all the emails which should be use in my VBA.
To do it, I wrote all emails inside of VBA.
Example:
Sub email ()
Dim OutApp As Object
Dim OutMail As Object
To_Austria = "xxxx@gmail.com";"yyyyy@gmail.com;"
CC_Austria= "xxxx@gmail.com";"yyyyy@gmail.com;"
To_Belgium = "xxxx@gmail.com";"yyyyy@gmail.com;"
CC_Belgium= "xxxx@gmail.com";"yyyyy@gmail.com;"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "To_" & Sheet8.Cells(4, 3)
.CC = "CC_" & Sheet8.Cells(4, 3)
.BCC = ""
.Subject =""
.Body =
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
The sheet Sheet8.Cells(4, 3) is the country which appear in the file and it can be changed manually.
When I run the macro, outlook show the text "To_Austria" and "CC_Austria" instead of emails. How could I make the VBA to take email?
regards,