PDA

View Full Version : Macro-Enabled documents are slow to open



GreenMonkey
01-20-2011, 04:12 PM
Does anyone know how to get macro-enabled documents (.docm files) to open faster. Opening a larger document (~10 pages) is almost like watching paint dry. Thanks!

Tinbendr
01-21-2011, 06:10 AM
Add-ins are usually the culprit, but since you don't describe your document at all, it's only a guess.

David

fumei
01-21-2011, 09:57 AM
Dave is right.

GreenMonkey
01-21-2011, 01:43 PM
Thanks for the replies. The documents are quite basic. They consist of a heading (the title of the document) followed by headers which are followed by tables. Within the tables are toggle buttons that contain macros that simply change the color of the adjacent text depending on the position of the toggle.

Tinbendr
01-21-2011, 02:58 PM
Word does suffer from document bloat occasionally. If there are no add-ins, then the document could be corrupt.

You can start a new document and move one thing over at a time to see if any particulat object is causing the bloat/delay.

Writing, deleting. adding al lot of VBA over time can casue bloat. Exporting all the code/userforms, then importing sometime will cure this.

Here is an article (http://word.mvps.org/faqs/macrosvba/TemplateBloat.htm) describing it.

Sorry I wan't any more help.

Good luck!

GreenMonkey
01-21-2011, 03:14 PM
Thanks, David. I'll play around with your suggestions. Appreciate the help!

Paul_Hossler
01-22-2011, 03:21 PM
1. A posibility is that your antivirus software is scanning the word macros

2. Try a new DOCM with only a simple macro as see if it's still slow

3. Word (2007/2010) has a lot of locations that have templates that load. Rename them all and see. Maybe one of them is causing the slowdown

Paul

fumei
01-24-2011, 10:00 AM
Tinbendr is correct. If your file had a lot of code that was modified, even if it is noe deleted, Word can get memory fat. It is a good practice if you have a lot of code (even if it has not been majorly modifed) to export/import code modules.

Tinbendr is also correct in his first suggestion. Addins and COM addins are a seriously drag on Word at times. That is a the first place to look. From the bare description, it does not sound like code bloat, but it could be. I would check addins first.

Paul is also correct. AV software can have amazing effect on the opening of Word documents.

Paul is also correct

Paul_Hossler
01-24-2011, 01:19 PM
Possibly useful

http://word.mvps.org/faqs/macrosvba/TemplateBloat.htm




This can be a long and involved process. The Word Code Cleaner (see below) automates the portion involving export and import of code modules. In addition to cleaning your project this way, the Word Code Cleaner can optionally strip comments, blank lines, and spaces from your code. This allows you to achieve the minimum possible file size for your project.
Obtaining the Word Code Cleaner

The Word Code Cleaner was originally written by Rob Bovey for Excel, then modified to run in Word by Robert Affleck, and has since been updatedby Bill Coan (http://word.mvps.org/AboutMVPs/bill_coan.htm). It will work with Word 97, Word 2000 and Word 2002. The Word Code Cleaner does not work with any version of Word for Macintosh.

http://word.mvps.org/Images/IconsAndLogos/ZipIcons/CodeCleaner.gif (http://word.mvps.org/Downloads/WordCodeCleaner.zip)Click the Zip icon to download the file.
Unzip it.
Double-click the .exe file to install the addin.
Start Word and choose Tools|Word Code Cleaner.If the Word Code Cleaner doesn't fix your problem, have a look at WD2002: Part 1: Troubleshooting Problems When Word Has Encountered a Problem and Needs to Close (http://support.microsoft.com/default.aspx/kb/822645/en-us?FR=1)which provides very detailed information on how to track down the causes of Office IPFs (any version).


http://word.mvps.org/Downloads/WordCodeCleaner.zip

Paul

fumei
01-24-2011, 01:49 PM
It works. Although it is almost as easy to do it yourself.

Paul_Hossler
01-24-2011, 05:39 PM
It works. Although it is almost as easy to do it yourself.

If you have a number of Modules and userforms (and possibly Classes), I'd prefer to let the comp do all the grunt work.

One or two, I could handle without messing up (probably :) )

Paul