声明变量 [英] Declare Variable

查看:106
本文介绍了声明变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sam,

我在新excel sheet1中将这些输入文本输出到visio VBA后,我尝试将包括Sheet1,Module和ThisWorkbook在内的所有内容移动到已存在许多其他模块的excel应用程序中。但在移动之后,那些声明的visio变量,例如Public vsApp as visio.application。或者Dim vsDocs as visio.documents。突出显示并出现错误消息Complie error:用户定义的类型未定义。但有些声明如Dim vFile as Variant等。不会被选中。你知道这是什么原因吗?

谢谢

解决方案


Sam,

在新excel sheet1中将这些输入文本输出到visio VBA后,我尝试将包括Sheet1,Module和ThisWorkbook在内的所有内容移动到已存在许多其他模块的excel应用程序中。但在移动之后,那些声明的visio变量,例如Public vsApp as visio.application。或者Dim vsDocs as visio.documents。突出显示并出现错误消息Complie error:用户定义的类型未定义。但有些声明如Dim vFile as Variant等。不会被选中。你知道是什么原因吗?

谢谢



你需要一个对Visio对象库的引用。使用VBA编辑器中的工具,引用菜单添加它。



您需要对Visio对象库的引用。使用VBA编辑器中的工具,参考菜单添加它。



哦,是的,我多么愚蠢!



oh,是的,我多么愚蠢!



但是,你变得更聪明了!对? ;)


Sam,
After I finish those input text to visio VBA in new excel sheet1, I try to move everything including Sheet1, Module, and ThisWorkbook to a excel application already exist with many other modules. But after moved, those declared visio variable such as "Public vsApp as visio.application" or "Dim vsDocs as visio.documents" got highlight and come out a error message "Complie error: User-defined type not defined". But some declaration such as "Dim vFile as Variant" won''t be selected. Do you know what is the reason for that?
Thanks

解决方案

Sam,
After I finish those input text to visio VBA in new excel sheet1, I try to move everything including Sheet1, Module, and ThisWorkbook to a excel application already exist with many other modules. But after moved, those declared visio variable such as "Public vsApp as visio.application" or "Dim vsDocs as visio.documents" got highlight and come out a error message "Complie error: User-defined type not defined". But some declaration such as "Dim vFile as Variant" won''t be selected. Do you know what is the reason for that?
Thanks

You need a reference to the Visio object library. Use the Tools, References menu in the VBA Editor to add it.


You need a reference to the Visio object library. Use the Tools, References menu in the VBA Editor to add it.

oh, yeah, how stupid I am!


oh, yeah, how stupid I am!

But, you are getting smarter! Right? ;)


这篇关于声明变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆