引用类时:”名称已与存在的模块或工程,对象冲突”咋回事啊?

wzh815 2003-07-21 10:57:15

做了个调用WORD的类,并用REGSVR32注册过。

但在VB中引用却说:

引用类时:”名称已与存在的模块或工程,对象冲突”咋回事啊?


请帮忙看看是什么原因?
我是DLL初学者。
...全文
680 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
pigpag 2003-07-22
  • 打赏
  • 举报
回复
注意,也不要在DLL中用CheckBox,CommandButton,Timer之类敏感的词语
wzh815 2003-07-22
  • 打赏
  • 举报
回复
I rename the module. Then everything is ok.

The project name is "SaveWord" and the module name is "Toword".

There is a function named "UpdateWord" in this module.

But when I write the code: set ttt = createobject(saveword.

I want to see the function name, but nothing occured. It said"未找到方法或数据成员"

What's the matter?? Help me...


The module function is as following:
===========================

Public Function UpdateWord(strarr() As Byte) As Integer

Dim Wobj As Word.Application
Dim wordDoc As Word.Document

Set Wobj = CreateObject("Word.Application")

Set wordDoc = Wobj.Documents.Open("c:\subject.doc")

Wobj.Application.Visible = False

Wobj.Selection.Find.ClearFormatting
Wobj.Selection.Find.Replacement.ClearFormatting


For i = 1 To 10
If IsNull(strarr(i, 1)) = False And strarr(i, 1) <> "" Then

strRep = strarr(i, 2)

With Wobj.Selection.Find
.Text = strarr(1, 1)
.Replacement.Text = strRep
.Forward = True
.MatchByte = True
End With

Wobj.Selection.Find.Execute Replace:=wdReplaceAll


End If

Next i



wordDoc.Save
wordDoc.Close


Set wordDoc = Nothing
Set Wobj = Nothing

toword = 1

End Function
since1990 2003-07-22
  • 打赏
  • 举报
回复
调用的类名与已经存在的模块名称相同。

修改模块名称
wzh815 2003-07-22
  • 打赏
  • 举报
回复
请高手赐教了。。
qingming81 2003-07-22
  • 打赏
  • 举报
回复
调用的类名与已经存在的模块名称相同。
sunnyfire 2003-07-22
  • 打赏
  • 举报
回复
出现了重复引用,或者是已存在的引用和你正引用的类有重复
gemgama 2003-07-21
  • 打赏
  • 举报
回复
你所引用的类名和你的模块或工程的名发生冲突
你可以修改你的模块或工程的名来避免冲突

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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