How does VBA cause Word crashes?

  • Thread starter christophercbrewster via OfficeKB.com
  • Start date
C

christophercbrewster via OfficeKB.com

I asked a long-winded question and got no answers, so here's the short
version. My program allows some control of Powerpoint from Word, and
something makes the whole thing unstable. It works for a while, but then Word
crashes. (I wasn't having this problem last time I used it.) Are there rules
or patterns about what could cause this? Any suggestions to trace it? Thanks.

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/201002/1
 
D

Doug Robbins - Word MVP

Possibly failing to set objects to nothing.

--
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
 
J

Jay Freedman

The most common cause of a "works for a while and then crashes"
problem is something that allocates memory (or sometimes other
resources such as file handles) and fails to release it. Eventually
that can chew up all the memory available in certain limited areas,
even though there may still be gobs of memory available for other
uses. I'd have to say this kind of thing is rare in VBA unless you're
(incorrectly) using Win32 API calls.

The other kind of problem that comes to mind is a data-driven error.
In this kind, the program makes some assumptions about the data it's
working with, and everything works fine until some "malformed" or
unexpected data happens to appear. But most such problems in VBA just
trigger an error message and the macro stops, rather than a full-blown
crash of Word.

One tool for troubleshooting program crashes is the Windows Event Log.
You'll find this in the Administrative Tools section of Start >
Settings > Control Panel (in Windows XP); in Vista or Windows 7, just
type "Event Viewer" in the search box on the Start menu. Look for
errors logged in the Application and System logs near the time of the
crash. You may not get much more than an error code, something like
"0x00000005", but you can then use Google or Bing to look up its
meaning.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top