word crashes when using exit macros for a form field

  • Follow


Hi all,

we have Word 2003 and I've programmed many applications for my agency using 
VBA macros; including several for forms.

recently though, we've found some newer pcs will crash, if we have a form 
with an exit macro one a checkbox, and the exit macro does some significant 
processing (say running through a collection of fields looking for other 
checkboxes which are checked).

What happens is that Word says it has encountered an error and must close 
when they click into another form field (this other form field *does not* 
have an entry macro).

If I put an "exit sub" at the top of the exit macro in question, all is ok. 
on slower pcs all is ok.

Does anyone have any ideas?

thanks.

Chip



0
Reply Chip 4/8/2010 8:27:19 PM

If you showed us the code in the macro it might help.

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Chip Orange" <Chip.Orange@psc.state.fl.us> wrote in message 
news:#JnHtn11KHA.3652@TK2MSFTNGP04.phx.gbl...
> Hi all,
>
> we have Word 2003 and I've programmed many applications for my agency 
> using VBA macros; including several for forms.
>
> recently though, we've found some newer pcs will crash, if we have a form 
> with an exit macro one a checkbox, and the exit macro does some 
> significant processing (say running through a collection of fields looking 
> for other checkboxes which are checked).
>
> What happens is that Word says it has encountered an error and must close 
> when they click into another form field (this other form field *does not* 
> have an entry macro).
>
> If I put an "exit sub" at the top of the exit macro in question, all is 
> ok. on slower pcs all is ok.
>
> Does anyone have any ideas?
>
> thanks.
>
> Chip
>
>
> 
0
Reply Doug 4/9/2010 1:30:56 AM


Hi Doug,

it's related to use of the .checkbox property of formfields which are 
checkboxes.  I had a routine which ran through all formfields, identified 
those which were checkboxes, and did a calculation which it ultimately 
placed in another field of the form.

when I stopped doing this, the crash stopped happening.

When I switched to use of the .result property instead of the 
..checkbox.value, the crashing stopped.  (you can't set a checkbox using 
..result, but it will return a "0" for false, or "1" for true).

Next however, instead of crashing, I found that even use of the .result 
property of a checkbox form field which ocasionally make the document shift 
position by as much as half a screen (users described it as "screen 
jumping").

I removed all writing to form fields, and this helped a lot, but a big part 
of this automation project was to have been automatically calculated and/or 
populated form fields.  I've concluded with Word 2003 anyway, this just 
isn't possible.

Is any of this a "known issue"?  Are there known work arounds?

thanks.

Chip

"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> wrote in message 
news:82888CEC-38AC-4FCE-BA27-AA60436B2635@microsoft.com...
> If you showed us the code in the macro it might help.
>
> -- 
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
>
> "Chip Orange" <Chip.Orange@psc.state.fl.us> wrote in message 
> news:#JnHtn11KHA.3652@TK2MSFTNGP04.phx.gbl...
>> Hi all,
>>
>> we have Word 2003 and I've programmed many applications for my agency 
>> using VBA macros; including several for forms.
>>
>> recently though, we've found some newer pcs will crash, if we have a form 
>> with an exit macro one a checkbox, and the exit macro does some 
>> significant processing (say running through a collection of fields 
>> looking for other checkboxes which are checked).
>>
>> What happens is that Word says it has encountered an error and must close 
>> when they click into another form field (this other form field *does not* 
>> have an entry macro).
>>
>> If I put an "exit sub" at the top of the exit macro in question, all is 
>> ok. on slower pcs all is ok.
>>
>> Does anyone have any ideas?
>>
>> thanks.
>>
>> Chip
>>
>>
>> 


0
Reply Chip 4/13/2010 4:14:19 PM

2 Replies
509 Views

(page loaded in 0.125 seconds)

Similiar Articles:
















7/24/2012 12:42:27 PM


Reply: