excel - 在 Excel 应用程序中创建 Outlook 项目会生成错误 : "Object doesn' t support this property or method"

标签 excel vba outlook

下面是 Excel 宏的开头。我始终收到消息

"Object doesn't support this property or method.

Sub RegisterAppointmentList(CName As String)

    ' adds a list of appontments to the Calendar in Outlook
    Dim olApp As Outlook.Application
    Dim olApptItem As Outlook.AppointmentItem

    Set olApp = GetObject("", "Outlook.Application")

    Set olApptItem = Application.CreateItem(olAppointmentItem)

    On Error Resume Next

最佳答案

换行

Set olApptItem = Application.CreateItem(olAppointmentItem)

Set olApptItem = olApp.CreateItem(olAppointmentItem)

关于excel - 在 Excel 应用程序中创建 Outlook 项目会生成错误 : "Object doesn' t support this property or method",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65974681/

相关文章:

sql-server - 将数据从 Excel 导入 MS SQL Server 时如何创建标识列(使用导入和导出向导)?

vba - 合并表格单元格

outlook - 如何在 Exchange 2007 w/SP2 中设置 "Mark Completed"标志

Excel 2010 - 在工作簿中存储功能区自定义

vba - 执行 URLDownloadToFile 函数返回 E_ACCESSDENIED 公司网络上的一般访问被拒绝错误 0x80070005

excel - 在 Excel 自定义函数中将 NOW() 作为参数传递会产生 #VALUE!错误?

excel - 将表格向下推到工作表上时如何保持行高不变

VBA - 图书馆中的专有名称管理

vba - 触发函数,更改字体,当 Outlook 电子邮件创建时 : "The item' s properties and methods cannot be used inside this event procedure. "

java - 如何使用 java ews api 将电子邮件标记为已读