vba Visual Basic 成员已存在于对象模块中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24274090/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 03:29:50  来源:igfitidea点击:

Visual Basic Member Already Exists in an object module

vba

提问by Ryan Newman

I am brand new to visual basic today and I was writing my program but I get a compile error

我今天是visual basic的新手,我正在编写我的程序,但出现编译错误

Member already exists in an object module from which this object module derives

成员已存在于从该对象模块派生的对象模块中

My function prototype is

我的函数原型是

Function calculate(count As Integer) As String

I was wondering why this is giving me this error

我想知道为什么这给我这个错误

回答by Monty Wild

It would appear that you are designing a form, and have an object on that form (such as a text box or command button) which is also named calculate, disregarding case, since VBA is generally not case sensitive.

看起来您正在设计一个表单,并且在该表单上有一个对象(例如文本框或命令按钮),该对象也命名为calculate,不区分大小写,因为 VBA 通常不区分大小写。

回答by Toddt

It is because your function has same name as the system's reserve function name, such as AfterInsert()

那是因为你的函数和系统的保留函数名同名,比如 AfterInsert()