Y
Yannis
Hi,
I had a VBA program within Excel that used to work (included below):
This VBA sub, would just email me the active workbook from Excel.
However, my company now has included some sort of increased protection in
Outlook and
when I run the macro now, I get a message that a third party program is
trying to send an email
through Outlook and it needs confirmation to send the email.
Does anyone know of a workaround for this?
I would like to email myself an excel file at regular intervals...
Thanks in Advance!
----------------------------------------------------------------------------
------------------------------
Sub eMail_file(strMail As String, strSubject As String, strBody As String)
'This example sends the last saved version of the Activeworkbook
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = strMail
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = strBody
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add (strFname)
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
----------------------------------------------------------------------------
I had a VBA program within Excel that used to work (included below):
This VBA sub, would just email me the active workbook from Excel.
However, my company now has included some sort of increased protection in
Outlook and
when I run the macro now, I get a message that a third party program is
trying to send an email
through Outlook and it needs confirmation to send the email.
Does anyone know of a workaround for this?
I would like to email myself an excel file at regular intervals...
Thanks in Advance!
----------------------------------------------------------------------------
------------------------------
Sub eMail_file(strMail As String, strSubject As String, strBody As String)
'This example sends the last saved version of the Activeworkbook
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = strMail
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = strBody
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add (strFname)
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
----------------------------------------------------------------------------