Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel VBA模块功能未定义access 2010_Excel_Vba_Ms Access - Fatal编程技术网

Excel VBA模块功能未定义access 2010

Excel VBA模块功能未定义access 2010,excel,vba,ms-access,Excel,Vba,Ms Access,我想在我目前正在处理的项目中使用我在另一个.mdb中创建的一些函数。 我首先进入VBA编辑器(alt+f11)并右键单击->导出…->在我的桌面上另存为module1.bas 然后我打开另一个项目,右键单击->导入->模块1.bas 现在我在其他模块中看到了module1,因此我在代码中使用了一些函数,我单击了SaveandCompile Compile Error Sub or Function not defined. 它指向我刚才导出的模块中定义的函数。如果我写: module1.fu

我想在我目前正在处理的项目中使用我在另一个.mdb中创建的一些函数。 我首先进入VBA编辑器(alt+f11)并右键单击->导出…->在我的桌面上另存为module1.bas 然后我打开另一个项目,右键单击->导入->模块1.bas 现在我在其他模块中看到了module1,因此我在代码中使用了一些函数,我单击了SaveandCompile

Compile Error Sub or Function  not defined.
它指向我刚才导出的模块中定义的函数。如果我写:

module1.functionName parameter
它可以编译,但我通常不必像那样键入引用。为什么会这样?
如何将我的模块引用到我的项目?

子模块和函数在我的模块中定义为私有。 改为将其公开

即:


编辑:没关系,它仍然不起作用编辑:编辑:我自己发现了我的错误。羞耻地分享,提醒你仔细检查代码。SUB和函数在我的模块中是私有的。谢谢你让我们知道。请考虑把你的调查结果作为一个答案来说明问题已经解决了。
Public Sub subName ()