VB6编的发送邮件 运行时错误'429' ActiveX部件不能创建对象 (win7+office2010)

wagezhou 2011-11-01 11:05:03
我的编程环境: WIN XP + OFFICE2003 VB6.0
使用环境: WIN XP + OFFICE 2003;WIN XP + OFFICE 2007;WIN7 + OFFICE 2007;WIN7 + OFFICE 2010

我的程序如下:
Dim objOutlookApp As Object
Dim objMail As Object

Set objOutlookApp = CreateObject("Outlook.Application")
Set objMail = objOutlookApp.CreateItem(0)

With objMail
.Subject = "Hello!"
.To = txtSendto.text
.Body = "Hello! It's test."
.Send
End With

打包,安装,都没有问题。

目前的问题是,大部分使用环境都没有问题,运行正常,但是部分WIN7 + OFFICE 2010的环境下,会出现“运行时错误'429' ActiveX部件不能创建对象”的问题。有些WIN7 + OFFICE 2010的环境下是可以正常运行的。

请大家帮忙看看,谢谢!
...全文
942 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wagezhou 2011-12-22
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 cdz1980 的回复:]
检查OFFICE是否是精简版的
[/Quote]

不是,谢谢!
cdz1980 2011-11-30
  • 打赏
  • 举报
回复
检查OFFICE是否是精简版的
yuanhao50619 2011-11-30
  • 打赏
  • 举报
回复
楼主的问题和我一样啊,我的2007也是这个问题

http://topic.csdn.net/u/20111130/15/698f998d-49ab-41e1-b497-348a4431fa37.html?73176

而且我的问题更大
wagezhou 2011-11-02
  • 打赏
  • 举报
回复
1.你引用了Office组件,由于版本不一致,所以无法创建对象;
如果版本不一致,那么为什么在有些使用环境WIN7 + OFFICE 2010下可以使用,而有些不行?
我的开发环境:WIN XP + OFFICE2003 VB6.0
如果因为版本的原因,我个人觉得不太可能。

2.访问一些COM组件需要管理员权限,用户不是管理员登录。
我“引用”的是Microsoft Outlook 11.0 Object Library
程序掉用这个组件,需要管理员权限吗?
关于权限问题,我前面也说了,我没有注意,因为我不知道如何注意,所以请说明白一点?

3.你也要确认一下Office安装的是否注册了运行时表(ROT),具体你可以参考以下链接看看,这个发生的可能性很小.
http://support.microsoft.com/search/default.aspx?query=rot&a……
这点不是很懂,我只知道我们公司的电脑系统安装是统一的没有问题。

不管怎么说,非常感谢您的回复!
贝隆 2011-11-01
  • 打赏
  • 举报
回复
问题应该出在:
Set objOutlookApp = CreateObject("Outlook.Application")
Set objMail = objOutlookApp.CreateItem(0)
这两句的其中一句上
把OFFICE2010换成和你编写代码环境下一样的OFFICE。我认为是引用版本的问题。
wagezhou 2011-11-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 worldy 的回复:]
应该是权限的问题
[/Quote]

能说的清楚一点吗?什么权限?如何设置?谢谢!
worldy 2011-11-01
  • 打赏
  • 举报
回复
应该是权限的问题
神马都能聊 2011-11-01
  • 打赏
  • 举报
回复
你的问题原因大概三种可能:
1.你引用了Office组件,由于版本不一致,所以无法创建对象;
2.访问一些COM组件需要管理员权限,用户不是管理员登录。
3.你也要确认一下Office安装的是否注册了运行时表(ROT),具体你可以参考以下链接看看,这个发生的可能性很小.
http://support.microsoft.com/search/default.aspx?query=rot&mode=r&catalog=LCID%3D2052
wagezhou 2011-11-01
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 veron_04 的回复:]
那你注意过权限吗?
[/Quote]

没有注意,请问如何注意?谢谢!
贝隆 2011-11-01
  • 打赏
  • 举报
回复
那你注意过权限吗?
wagezhou 2011-11-01
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 veron_04 的回复:]
问题应该出在:
Set objOutlookApp = CreateObject("Outlook.Application")
Set objMail = objOutlookApp.CreateItem(0)
这两句的其中一句上
把OFFICE2010换成和你编写代码环境下一样的OFFICE。我认为是引用版本的问题。
[/Quote]

你的意思是把OFFICE2010卸了 重装2003吗?
但是部分Win7+OFFICE2010的环境下,程序没有问题.
1 , vb5dialog.zipThis demonstrates how to subclass the Common Dialog Dialogs and manipulate a specific Dialog.2 , cpnl.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).3 , vbo_progbar.zipImplement a common control progress bar with added features that are not accessable using COMCTL32.OCX! 4 , vbo_infolabel.zipThis control adds a great user-friendly interface with and icon and "Hover" ability. Based on a control seen in ICQ. 5 , vbo_checkcombo.zipAdd a checkbox to a combo box and use it to enabled/disable the combo! or whatever you would like to do with it! 6 , vbo_controlframe.zipCreate your own system button such as a Maximize, Minimize, Close, and many others with ease! 7 , vbo_ctextbox.zipThis class makes using the Textbox or Edit class API simple. Easily set properties and access many features not available directly from VB. 8 , taskbar.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).9 , NT_Service.zipThis is an OCX that allows you to create an NT service application...add the control to your project and register it as a service!!10 , Scroller.zipThis is a Control Container, it's like a frame control but it lets you scroll the content up and down...11 , TrayArea.zipThis control lets you add your icon to the System Tray Area and handle some events such as MouseMove, MouseDown, MouseUp and DblClick.12 , Resizer.zipThis is a very useful control: It's a container control, you can insert two controls inside and then you'll have a vertical (or horizontal) resizer bar (like the Windows File Explorer). A resizer can contain another resizer... an so on. (you can divide you form in as many sizable sections as you want...).13 , Label3D.zipTh

2,462

社区成员

发帖
与我相关
我的任务
社区描述
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。
社区管理员
  • VBA
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧