admin管理员组文章数量:1399211
I have an Excel sheet that acts as a 'form' and uses VBA to walk users through the workflow. When the next persons input is needed, the user presses a 'Submit' button and VBA triggers an email to inform the next person of their action. This is the code that sends the email:
'will open email for sucsessful submit
' /
Dim OutlookApp As Object
Dim OutlookMail As Object
' Create a new instance of Outlook
Set OutlookApp = CreateObject("Outlook.Application")
' Create a new email
Set OutlookMail = OutlookApp.CreateItem(0)
' Set the properties of the email
With OutlookMail
.To = ActiveWorkbook.Worksheets("sheet").Range("A7")
.CC = ""
.BCC = ""
.Subject = ActiveWorkbook.Worksheets("sheet").Range("A8")
.Body = ActiveWorkbook.Worksheets("sheet").Range("A9")
.Display 'Use .Send instead of .Display to send the email without displaying it
End With
' Clean up
Set OutlookMail = Nothing
Set OutlookApp = Nothing
This works. I do not get any errors with this.
Some users got the following error:
But this was resolved by updating Microsoft Office which was available through IT.
Then a second problem occurred, with the same error, but only situationally:
If the user presses the 'Submit' button with Outlook OPEN, the email generation will fail. If they CLOSE Outlook, and press 'Submit', it works fine. The error is the SAME as above:
What could possibly cause this? This does not happen on my machine at all, which has made troubleshooting tough as it simply does not happen to me. Does anyone have any thoughts? Thanks in advance.
本文标签:
版权声明:本文标题:excel - Getting a "System Error &H80080005 (-2146959355). Server execution failed" when sending an ema 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744133066a2592266.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论