Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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
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.