简体   繁体   English

VBA:使用本地Outlook从远程Excel发送电子邮件

[英]VBA: send email from remote excel using local outlook

The problem I am trying to solve is that I want Excel to send an email through Outlook. 我要解决的问题是我希望Excel通过Outlook发送电子邮件。 This is worked fine when I am using a local installation of Excel. 当我使用本地安装的Excel时,此方法工作正常。 However I need to be able to do the same using an installation of Excel on a server. 但是,我需要能够使用服务器上的Excel安装来执行相同的操作。 The debugger points to this line in the code: 调试器指向代码中的这一行:

Set OutApp = CreateObject("Outlook.Application", "localcomputername")

At first I tried without reference to local computer this gave me error: 起初,我尝试不参考本地计算机就给了我错误:

Runtime Error 429 - ActiveX Component Can't Create Object 运行时错误429-ActiveX组件无法创建对象

With the line above I get the following errormessage: 在上面的行中,我收到以下错误消息:

Runtime error 463 - class not registered on local machine 运行时错误463-类未在本地计算机上注册

Hope someone can help me 希望可以有人帮帮我

When you use the New operator or the CreateObject function in Microsoft Visual Basic to create an instance of a Microsoft Office application, you may receive the following error message: 当您在Microsoft Visual Basic中使用New运算符或CreateObject函数创建Microsoft Office应用程序的实例时,您可能会收到以下错误消息:

Run-time error '429': ActiveX component can't create object 运行时错误“ 429”:ActiveX组件无法创建对象

This error occurs when the Component Object Model (COM) cannot create the requested Automation object, and the Automation object is therefore unavailable to Visual Basic. 当组件对象模型(COM)无法创建请求的自动化对象,因此自动化对象对于Visual Basic不可用时,会发生此错误。 This error does not occur on all computers. 并非在所有计算机上都会发生此错误。

View this for More information - https://support.microsoft.com/en-in/kb/828550 查看此以获取更多信息-https://support.microsoft.com/en-in/kb/828550

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM