Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2006, 11:14 AM
Registered User
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unstable VBA in Word Template

We have written an application in VBA in a Word Template. This application has been written over a number of months and various bits added etc. At one point the application became unstable. Word would crash unexpectedly. We then went through the application and made sure that there was no redundant procedures left in the project. We also reduced the size of several arrays. After this the project was again stable. More features were then added to the project and once again it became unstable. We again redimensioned arrays to smaller sizes and all was well again. This suggests to us that VBA may be running out of memoery.

The project is complex and uses many forms, some of which have command buttons with graphics rather than text. We have used .GIF files for the graphics. The template, when saved, is about 2800Kb.

Is it a memory/resource problem. If so does any one know how to fix the probem? Are there limits on the size of an application?





 
Old June 5th, 2006, 03:47 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I would guess that it is a threshold problem. Some categories have a maximum size. For instance, an integer in VB can only be 32,767 to -32,768. You don't run out of memory if you exceed that, you exceed the gizmos limitations.

Now, integers are automatically checked for exceeding that, but you might be encountering some more subtle area that nonetheless has a threshhold.

The next thing I would try would be putting parts of the functionality that you need and put it into different templates, so that the whole app is not in just one template.

Also, be sure to limit your use of global items.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Secondary Data Source for Word Template Loralee Access 2 May 9th, 2006 07:48 PM
passing values into word template narendrapawar VB How-To 1 April 5th, 2005 12:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.