I am using windows 10 and Excel 2016
I am using windows 10 and Excel 2016
Welcome to the forum!
Sounds like you have an error in code? In the VBE toolbar, select Reset. I normally put Debug menu Compile on toolbar and compile before a run. If not error, Tools > References will show installed library objects.
Please problem is Microsoft outlook is not showing in reference library, I want to add it.
You don't need to add it. You can use late binding to Outlook. e.g. If Outlook is installed and working then the following will work.
Better still use the code from 'http://www.rondebruin.nl/win/s1/outlook/openclose.htm to start Outlook
Option Explicit Global EMAILTARGET As String Sub SENDEMAILO() Dim O As Object Dim OMAIL As Object EMAILTARGET = "someone@somewhere.com" Set O = CreateObject("Outlook.Application") Set OMAIL = O.createitem(0) OMAIL.To = EMAILTARGET OMAIL.Subject = "Reminder Save DT" OMAIL.Send MsgBox "email sent" End Sub
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com
Hi,
I have tried this code and outlook is also installed but it is saying that cant create object
That code should send a simple message. It sounds like Outlook is not properly installed - try repairing Office.
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com