T
Todd
I have written code that will automatically send a
workbook as an attachment in Outlook to a designated
address, however, when it runs Outlook pops up a box that
says "A program is trying to automatically send email on
your behalf...." Is there anyway to keep this from poping
up? The code I have written is below:
Sub Mail_workbook_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = OutApp.CreateItem(0)
End Sub
workbook as an attachment in Outlook to a designated
address, however, when it runs Outlook pops up a box that
says "A program is trying to automatically send email on
your behalf...." Is there anyway to keep this from poping
up? The code I have written is below:
Sub Mail_workbook_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = OutApp.CreateItem(0)
End Sub