![]() |
#1
|
|||
|
|||
![]()
Hi, I have a task-scheduler spreadsheet with VBA that edits and the calls a wscript .vbs file. It all works smoothly right up until the Outbox.
If I have Outlook open at the time of the spreadsheet running, I get an error of this. ActiveX component can't create object: 'Outlook.Application' Code: 800A01AD If I have Outlook closed at the time of the scheduled spreadsheet, then no error but the e-mail sits in the Outbox until Outlook is opened and then is sent almost immediately. I could schedule Outlook to open and close throughout the day when these spreadsheets are running but I'd rather it just worked when Outlook is open all the time. Here is the .vbs code Code:
Dim objOutl Set objOutl = CreateObject("Outlook.Application") Set objMailItem = objOutl.CreateItem(olMailItem) objMailItem.Recipients.Add ("john.smith@gmail.com") objMailItem.Display objMailItem.Subject = "Midnight Tank Stock Report" objMailItem.Body = "Here is my body" objMailItem.Send Set objMailItem = nothing |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Expanding "CC" field when sending an email in Outlook 2013 | Dougmeister | Outlook | 0 | 11-29-2017 06:57 AM |
![]() |
grjbyfleet | Outlook | 1 | 07-30-2016 11:52 AM |
outlook.com account in Outlook 2007 freezes at 93% sending/receiving email | ink8 | Outlook | 0 | 10-10-2012 12:19 PM |
Outlook not sending body of email | sbertram | Outlook | 0 | 08-30-2012 11:50 AM |
Receiving but not sending email in outlook? | babylikesburgh | Outlook | 2 | 12-05-2010 06:29 PM |