[英]Excel VBA Compile throws a “User-defined type not defined” error
I have an Excel file with a VBA code to send a outlook mail according specific excel cell contents, but it gave me a Compile error.我有一个带有 VBA 代码的 Excel 文件,可以根据特定的 excel 单元格内容发送 Outlook 邮件,但它给了我一个编译错误。
The first few lines of the code are copied in directly from the VBE as:代码的前几行直接从 VBE 复制为:
Dim OutApp As Object
Dim OutMail As Object
Dim impname As String
Dim leadname As String
Dim subje As String
Dim ns As Namespace
Dim myOlSel As Outlook.Selection
The error showing at " Dim ns As Namespace "显示在“ Dim ns As Namespace ”的错误
This code was working fine till last three day's but now it is showing an error msg.这段代码在过去三天之前一直运行良好,但现在它显示错误消息。 I have tried to clear Missing libraries form " Tools | References " but still I am facing the issue.
我试图清除“工具 | 引用”中缺少的库,但我仍然面临这个问题。
从显示的错误消息来看,您的代码可能缺少任何引用或导入的库,或者您正在使用的 excel 文件扩展名不支持宏
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.