Consulting

Results 1 to 6 of 6

Thread: Reference Library in excel VBA not showing Outlook application

  1. #1

    Reference Library in excel VBA not showing Outlook application

    I am using windows 10 and Excel 2016

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,786
    Location
    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.

  3. #3

    I have attached screenshot

    Please problem is Microsoft outlook is not showing in reference library, I want to add it.
    Attached Files Attached Files

  4. #4
    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

  5. #5

    I tried it but not working

    Hi,
    I have tried this code and outlook is also installed but it is saying that cant create object
    Attached Files Attached Files

  6. #6
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •