Using New Outlook on Windows for professional communication and productivity
Hi, I'm Diane and I'm happy to help you today.
This is an Outlook macro? If not, which office app is running the macro?
Is Outlook open when the macro runs? If so, you don't need to use createobject.
This will work if its an Outlook macro: Dim OutlookApp As Outlook.Application Set OutlookApp = Application
If you are running it from another office app, try this
Dim blnCreated As Boolean
Set OutlookApp = GetObject(, "Outlook.Application") If Err.Number <> 0 Then Set OutlookApp = CreateObject("Outlook.Application") blnCreated = True Err.Clear Else blnCreated = False End If
Let me know how it goes, I'm here to help you further if needed.
-- Diane