Strange behavior in Add-Ins 
Author Message
 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?



Sat, 19 Jul 2003 06:03:19 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. programmatic adding of add-ins

2. COM Add-INs, cannot restore a built-in Add-in

3. Add-ins not listing in add-in manager

4. How do I add a menu to the Add-Ins menu in Visual Basic 4.0

5. Add-Ins, How to add a Toolbar.Button

6. MoveFirst, MoveLast strange behavior

7. Strange Subform Record Behavior

8. word mail merge strange behavior

9. Strange behavior with INT function

10. strange behavior

11. Strange Behavior

12. Strange Behavior with queries in code

 

 
Powered by phpBB® Forum Software