I tried looking for the answer for this question, but go no where. So I understand if I declare a variable outside a sub/function, it's accessible to all the subs/functions with in that module. What about other modules? Do I have to declare it? Or can I use it without declaring it?
For example, I have a textstream object that's used for logging in multiple modules. Basically what I want do is to initialize them once and all the functions in my modules can use the same objTF object to write to a log file. These objects are initialized in a commandbutton_click event. But where do I declare them?
Dim objFSO As FileSystemObject
Dim objTF As TextStream
Do I have to put them at the beginning in all of the modules? Or only one of the modules is enough? What is the correct way to do it?
Thanks!!