Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2006, 11:14 AM
Registered User
Join Date: May 2006
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old June 5th, 2006, 03:47 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

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.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 01:06 PM.

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