D
David Horowitz
Hi folks,
I'm having a problem where it seems the VBA environment becomes unstable
during macro execution.
I have an extensive Word VBA program that runs in a 2003 .doc file.
It seems that sporadically (around 1 of 20 runs), one of two things happens:
1) either Word just terminates with no warning, or
2) constant values, usually strings, lose their values.
The 2nd one is very weird - the code will be something like:
Sub test()
Call PrintMe("Hello")
End Sub
Sub PrintMe(ByVal s As String)
MsgBox s ' s is blank
End Sub
And the MsgBox will show a blank value. My actual code is much more
complicated, but this illustrates the general idea.
This program uses ADO 2.8 (through early binding (Tools > References)- I
don't know if that might give anyone a clue.
I've never seen anything like this before in VBA. (In C programming, you'd
expect it all the time...)
I don't know if it's a line of my code that's causing a memory overrun, or
just a Word bug I'm hitting upon, or something else.
Does anyone have any clue for me?
Thank you very much.
I'm having a problem where it seems the VBA environment becomes unstable
during macro execution.
I have an extensive Word VBA program that runs in a 2003 .doc file.
It seems that sporadically (around 1 of 20 runs), one of two things happens:
1) either Word just terminates with no warning, or
2) constant values, usually strings, lose their values.
The 2nd one is very weird - the code will be something like:
Sub test()
Call PrintMe("Hello")
End Sub
Sub PrintMe(ByVal s As String)
MsgBox s ' s is blank
End Sub
And the MsgBox will show a blank value. My actual code is much more
complicated, but this illustrates the general idea.
This program uses ADO 2.8 (through early binding (Tools > References)- I
don't know if that might give anyone a clue.
I've never seen anything like this before in VBA. (In C programming, you'd
expect it all the time...)
I don't know if it's a line of my code that's causing a memory overrun, or
just a Word bug I'm hitting upon, or something else.
Does anyone have any clue for me?
Thank you very much.