Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't call global variables

Status
Not open for further replies.

SinisterDuck

Technical User
Jan 22, 2002
2
GB

Have created a macro in word. From my Main() function (which is public) i've declared several variables that i wanted to be global. On my PC called private functions using these variables compile and work but when i try to run them on other's PC's it says that these objects are missing.

So something isn't switched on, on their PC's but for the life of me i don't know what it is or how to switch it on so i would be grateful for any help.


 
Hi,
Have you located some of your Public variables or functions in your Normal?
If they are, you need to move them to the Document.

Let me know :) Skip,
metzgsk@voughtaircraft.com
 
Hi SinisterDuck,

Here's a thread on global variables

thread222-167802
 
cheers,

No all the coding's been done in the document, i try to aviod messing with the normal, just in case.

Um i'll try to clarify my coding to you,

i've written it in document with a public main function which defines global variables and calls private functions

ie...

Public Sub Main()

Dim 'Global Variables'

Call Private Function(1)
.
.
.
.
Call Private Function(n)

End sub

Private sub function(1)
.
.
Private sub function(n)

it's these Global Variables that havn't been recognised on the user's machines, so i've had to re-define them within each of the private functions or have had to send them when calling the function.

just a mad thought but it doesn't have anything to do with the fact i'm running NT and there using 95?

Anyway hope i've made some sense...

SDuck....



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top