Modules, Modules, Modules 
Author Message
 Modules, Modules, Modules

Can I define a module so that it becomes global?
(i.e. No need of Var1 = Module1.Sub1)
Any help would be appreciated.

Edwin



Wed, 28 Jul 2004 21:04:29 GMT  
 Modules, Modules, Modules
If the module functions or subs are public then they are global by default.

Max Bolingbroke


Quote:
> Can I define a module so that it becomes global?
> (i.e. No need of Var1 = Module1.Sub1)
> Any help would be appreciated.

> Edwin



Wed, 28 Jul 2004 21:31:42 GMT  
 Modules, Modules, Modules


Quote:
> Can I define a module so that it becomes global?
> (i.e. No need of Var1 = Module1.Sub1)
> Any help would be appreciated.

> Edwin

There are different types of modules, for example, form modules, usercontrol
modules, class modules, and standard modules.  Which one are you talking
about?

Mike



Wed, 28 Jul 2004 23:46:45 GMT  
 Modules, Modules, Modules
If you are talking about class modules, you could use a class in an
ActiveX DLL with the class Instancing property set to GlobalMultiUse,
adding a reference to the DLL in your main application.

John...............

Quote:

> Can I define a module so that it becomes global?
> (i.e. No need of Var1 = Module1.Sub1)
> Any help would be appreciated.

> Edwin



Thu, 29 Jul 2004 07:41:54 GMT  
 Modules, Modules, Modules
I think it would be better if I clarify my idea. By a module I mean a simple
module [extension .bas] (not class, not usercontrol). By global I mean
global throughout the project. Suppose I am running a math program with many
functions kept away in a module, I do not want to type ModuleMath,
ModuleMath, ModuleMath again and again. This is my problem. Can anyone help
me?

Thanks
Edwin


Quote:
> Can I define a module so that it becomes global?
> (i.e. No need of Var1 = Module1.Sub1)
> Any help would be appreciated.

> Edwin



Fri, 30 Jul 2004 23:51:08 GMT  
 Modules, Modules, Modules
Hi Edwin:

Quote:
> I do not want to type ModuleMath,
> ModuleMath, ModuleMath again and again.

The only time you need to qualify as procedure with it's module name is when there is more than one module that eposes the same
procedure.
For example, if you have two modules; Mod1 and Mod2 with the Test() procedure:

'Mod1
Public Sub Test()
End Sub

'Mod2
Public Sub Test()
End Sub

You would have to qualify with Test() you wanted to call:

Call Mod1.Test()
Call Mod2.Test()

If Mod2 did not exist, or there were no other modules that exposed a Test() procedure, then you could simply call the sub:

Call Test()

Hope this helps,

Doug.



Sat, 31 Jul 2004 00:12:18 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. VBA Module to Module

2. Circular Reference Between Modules when 2 Class Modules Listen to Each others Events

3. Referece a module and have it not run the module

4. Edit / change module witin module

5. Class modules 97 - Refering to array within a custom class module

6. Debug a module that changes code in a report module

7. Passing input box value from Form Module to report module

8. Call module functions from outside of module?

9. copy module to another module

10. UserForm code module not visible from normal module

11. Class Module and Module

12. Class Modules & Modules

 

 
Powered by phpBB® Forum Software