
Strange behavior in Add-Ins
I've developed an add-in to insert or delete line numbers in Access 97. It
uses the ReplaceLine method on a Module object. The weird part is that if I
use that method more than once (or any method of the Module object, in fact)
my add-in GPFs. So this doesn't work:
for i=1 to 10
modAny.ReplaceLine i, "Whatever"
Next i
But if I set the object variable to Nothing each time, the function works!
for 1=1 to 10
Set modAny= Modules("ModuleName")
modAny.ReplaceLine i, "Whatever"
Set modAny=Nothing
Next i
Not only that, but each time I put the add-in on a new machine, I have to
delete any lines that refer to the object variable (modAny), compile it, add
the line back in and then re-compile it. If I don't I get another GPF. All
of the GPFs are in the VBA.dll module.
What the hell is up with that?