Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
SuperRaven
Contributor
Contributor

Email sending under Office 365 doesn't work (but works under Office 20XX)

hi folks, 

my vbs macro for sending emails was working fine until I installed Office 365. 
Interestingly if I run the email related vbs from the windows command line it is still working, but not within Qlikview.

Qlikview stops after the line “Set OutApp = CreateObject("Outlook.Application")” and I need to kill Qlikview using the task manager.

Any ideas, pls.? TYIA


Dim OutApp 
Dim OutMail 
      
    Set OutApp = CreateObject("Outlook.Application")  
    Set OutMail = OutApp.CreateItemFromTemplate("C:\email_template.oft")
                 
    With OutMail
        .To = "XYZ@XZ.COM"
         .Subject = "test"
         .Body = "test body"
        .Send
    End With
       
    Set OutMail = Nothing
    Set OutApp = Nothing
1 Solution

Accepted Solutions
SuperRaven
Contributor
Contributor
Author

Ty so much Marcus for your suggestion.

Unfortunately I only get the error number -2147418113 without any further error desc.

I searched for further hints regarding this error number on the internet, but there is no really a solid guidance how to fix that.

In the meanwhile I finally found a solution here: 
Instead of creating a new outlook object
     set OutApp = CreateObject("Outlook.Application")

I use now this line:
    set OutApp = GetObject(,"Outlook.Application") 
b/c Outlook it already up and running on my desktop machine and it works.

View solution in original post

2 Replies
marcus_sommer

Maybe you could get an error-message with any hint what might be missing/wrong. Therefore try to include:

OnErrorResumeNext

...

msgbox err.number & chr(10) & err.description

- Marcus

SuperRaven
Contributor
Contributor
Author

Ty so much Marcus for your suggestion.

Unfortunately I only get the error number -2147418113 without any further error desc.

I searched for further hints regarding this error number on the internet, but there is no really a solid guidance how to fix that.

In the meanwhile I finally found a solution here: 
Instead of creating a new outlook object
     set OutApp = CreateObject("Outlook.Application")

I use now this line:
    set OutApp = GetObject(,"Outlook.Application") 
b/c Outlook it already up and running on my desktop machine and it works.