Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-12-2019, 07:10 AM
johnc83 johnc83 is offline Outlook 2013 - Sending email when closed Windows 7 64bit Outlook 2013 - Sending email when closed Office 2003
Novice
Outlook 2013 - Sending email when closed
 
Join Date: Jul 2015
Posts: 6
johnc83 is on a distinguished road
Default Outlook 2013 - Sending email when closed

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
Reply With Quote
 



Similar Threads
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
Outlook 2013 - Sending email when closed Outlook not sending email 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft