'RDCOMClient package suddenly gives me: No support for InterfaceSupportsErrorInfo
I've been using the RDCOMClient packge in R for over a year now without a problem.
Now suddenly it's giving me an error:
<checkErrorInfo> 80070057
No support for InterfaceSupportsErrorInfo
checkErrorInfo -2147024809
Error: The parameter is incorrect.
Here is my code (I've cleaned the code due to privacy):
library(RDCOMClient)
library(lubridate)
rmarkdown::render("/report.Rmd", encoding = "UTF-8")
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
text <- paste("Attached is the report")
path_to_attachment <- "W:\\Rwd\\report\\report_this_month\\report.pdf"
outMail[["to"]] = "[email protected]"
outMail[["subject"]] = "Monthly report"
outMail[["htmlbody"]] = text
outMail[["attachments"]]$Add(path_to_attachment)
outMail$Send()
rm(OutApp, outMail)
I have few other scripts that I schedule to send emails. One of them uses the blastula package (also sends email through Outlook) and I have no problem there.
Any idea why I'm getting this error?
Solution 1:[1]
I came across this error and was clueless for a while, but in my case it ended up being a matter of my attachment filepath being wrong.
If I were you I would try to first comment out the line outMail[["attachments"]]$Add(path_to_attachment) and see if things work as expected.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ricky |
