简体   繁体   English

Excel VBA 编译抛出“未定义用户定义的类型”错误

[英]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.

相关问题 后期绑定编译错误:未定义引用Excel VBA中的Outlook mailitem的用户定义类型 - Late binding compile error: User-defined type not defined referencing Outlook mailitem in Excel VBA 编译错误:未定义用户定义的类型Access / Excel参考 - Compile Error: User-defined type not defined Access/Excel Reference 如何修复编译错误:在 Outlook 中使用 Excel VBA 时未定义用户定义的类型? - How to fix Compile Error: User-defined type not defined when using Excel VBA from Outlook? Excel VBA On用户定义类型的错误处理 - Excel VBA On Error handling with User-Defined Type Compile 抛出“未定义用户定义的类型”错误,但不会转到有问题的代码行 - Compile throws a “User-defined type not defined” error but does not go to the offending line of code 如何在Microsoft VBA中解决此错误消息“编译错误:未定义用户定义类型” - How can I resolve this error message “Compile Error: User-defined type not defined” in Microsoft VBA excel vba userforms:未定义的用户定义类型 - excel vba userforms: user-defined type not defined 编译错误用户定义类型未在“oShell As WshShell”中定义 - compile error User-defined type not defined at “oShell As WshShell” 昏暗的字典。 编译错误:未定义用户定义的类型 - Dim As Dictionary. Compile Error: User-defined type not defined 使用Excel VBA发送Outlook电子邮件会生成错误:未定义用户定义的类型 - Sending Outlook Email Using Excel VBA generates error: user-defined type not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM