G'day "George Seese" <
[email protected]>,
1 Yes
2 Old instances of it in memory from bad object destructions - read
original message closely
3 Provided already.
Here's a more detailed (technical) explanation seeing as you obviously
thirst for knowledge:
Let's take a nice example. An already existing, being developed
module.
We start Word. Word compiles the project if it isn't done already.
There are no syntax errors so it compiles nicely. Thus it now 'knows'
that MyObject has a .ScrewUp method. When I declare a MyObject,
..ScrewUp appears in the dropdown.
I run a test and do this. Whether I have destroyed my objects or not,
we have now 'enforced' the latest 'definition' of that object. Word
now believes it knows everything about it.
So, I go and add .BallsUp as a new method. (Seeing as I write so many
bugs, I figure its best to name my routines accordingly
![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
) For the
beginners, a method is just a public sub or function inside the object
definition.
So, we go down to the calling routine and try adding in a .BallsUp to
our object. It doesn't appear! "Why not??!!??" asks George, ripping
his hair out in frustration at this strange problem.
Look up above in this message... oh... Word already thinks it knows
about this object. So, we have to force a 'new look' at what the
object is.
We run the simple sub, redeclaring our object, and Word now
'refreshes' its knowledge about this object. Our .ballsup now appears
nicely.
<Bows>
George Seese said:
Steve,
I was looking for:
1. If this is a problem others have.
2. What possibly causes the problem.
3. An easier workaround (most important).
Could you explain how the sub is executed? Do you link it to a menu option
or shortcut keys?
Your suggestion for destroying objects. What do you mean? I've been doing
VBA for years and have never "destroyed" an object. But I'm open to new
ideas, if you could provide more details.
Thanks,
George
Steve Hudson
Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products
http://www.geocities.com/word_heretic/products.html
Replies offlist may require payment.