我正在使用 Excel 2013、Windows 7、Groupwise 12。
代码应该很简单,但我一直收到错误
“Active X 组件无法创建对象”
我已经根据 Groupwise 的开发文档确定了参考资料,这只是他们的“gwcma1.dll”,我只是不知道发生了什么。
现在的理论是,Groupwise 的安装方式没有填充代码创建对象所需的注册表信息,即使它位于对象浏览器中。
代码:
Dim gwAccount As GroupwareTypeLibrary.Account2
Set gwApp = CreateObject("NovellGroupwareSession")
多年来,我一直在旧版本的 excel 和 windows 以及 groupwise 上使用此代码,但我无法弄清楚发生了什么变化。
- -编辑 - -
这是代码的开始部分。在这之后只是标准循环和所有工作的逻辑。
这是它的第一部分。在这一点之后,它只是标准循环和逻辑。
Sub EmailPDFs()
Dim i, k As Long
Dim PhysicianCount As Long
Dim StartPoint As Long
Dim CurrentNPI As Long
Dim CurrentEmail As String
Dim CurrentFileName As String
Dim CurrentFilePath As String
Dim CurrentDate As String
Dim EmailBody As String
'Declaration for Email
Dim gwMessage As GroupwareTypeLibrary.Message2
Dim gwAccount As GroupwareTypeLibrary.Account2
Dim gwApp As GroupwareTypeLibrary.Application
Set gwApp = CreateObject("NovellGroupwareSession")
Set gwAccount = gwApp.Login()
---编辑2---
我尝试了 Application2 仍然是同样的错误。我想我正在尝试旧的,并且对象上的属性相同,但是 Application2 允许您进行代理电子邮件访问,我并不担心。
为了创建一个新的应用程序,我可能需要刷新语法,但我假设你建议的是:
Dim xlApp as Excel.Application
Set xlApp = New Excel.Application 'Early Binding
Set xlApp = CreateObject(“Excel.Application”) 'Late Binding