Hi Guys,
I am trying to use the below code to send an Excel workbook via email.
The code works perfectly fine when manually running the macro, or with task scheduler set to "Run only when user is logged on"
However when change to "Run whether user is logged on or not" or Tick "run with highest privileges"
I get a Runtime Error 429 ActiveX cant create object
Any assistance would be much appreciated.
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.Body = "."
.Attachments.Add Application.ActiveWorkbook.FullName
.Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
I am trying to use the below code to send an Excel workbook via email.
The code works perfectly fine when manually running the macro, or with task scheduler set to "Run only when user is logged on"
However when change to "Run whether user is logged on or not" or Tick "run with highest privileges"
I get a Runtime Error 429 ActiveX cant create object
Any assistance would be much appreciated.
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.Body = "."
.Attachments.Add Application.ActiveWorkbook.FullName
.Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub