user10559826
user10559826

Reputation: 1

How to send Outlook items, using Excel VBA, when in Task Scheduler after upgrade to Office 2013?

I use MS Office 2013 and Windows 7 in a networked environment.

I have an auto-open Excel VBA program that sends files via Outlook and is scheduled via Task Scheduler.

This ran when I was on MS Office 2010, but my computer was wiped and reinstalled with MS 2013.

Some key points:

  1. The Excel files all work when I run them directly and the emails get sent via Outlook.

  2. Task Scheduler works when I use the setting "Run only when user is logged on" and emails get sent via Outlook.

  3. Task Scheduler works with the other parts of the Excel VBA when it runs as "Run whether user is logged on or not," but does not successfully send Outlook files. I know this because I included a line to save a file in a particular directory and it did save it there. I also saw Excel in the Task Manager processes. So it runs, but does not send the Outlook email.

Things I have tried already:

  1. Changed DCOM settings for Microsoft Excel and Outlook Message Attachment
  2. Created "C:\Windows\System32\config\systemprofile\Desktop" and "C:\Windows\SysWOW64\config\systemprofile\Desktop" directories

Upvotes: 0

Views: 1079

Answers (1)

Eric Legault
Eric Legault

Reputation: 5834

Using the Outlook Object Model in a Task Scheduler or in the context of a Windows Service is not supported, so this could explain some of the unexpected behaviour. See: https://support.microsoft.com/en-ca/help/237913/the-outlook-object-model-is-unsuitable-to-run-in-a-windows-service

Upvotes: 0

Related Questions