PDA

View Full Version : Memory limitations of add-ins?



janhemel
08-11-2015, 02:58 AM
I have a large Word-vba-application consisting of 9 add-ins, all .dotm-files. In one of these add-ins, a collection of (many) documents must be opened, modified and closed again.
This all works fine when I run the macro directly from the Macro development environment.

However, when I launch the macro in the add-in (by clicking a ribbon button) Word crashes. These are the details:
- Word crashes always in the act of opening a document
- the document on whose opening the crash occurs varies, even though the number and order of the documents is always the same. So sometimes it will crash at the 8th document, sometimes at the 40th
- Word 2010, 64-bits

I wonder: what is the difference between running a macro directly from a template and running it from this template, loaded as an add-in?
Are there any limitations on memory use, apart from the available memory in your computer?

gmaxey
08-11-2015, 03:24 AM
Try adding a Msgbox statement in your loop and see if it runs without error as you acknowledge the message box for each document. If that works, look at and try replacing the msgbox with a DoEvents statements

janhemel
08-11-2015, 05:19 AM
Try adding a Msgbox statement in your loop and see if it runs without error as you acknowledge the message box for each document. If that works, look at and try replacing the msgbox with a DoEvents statements
Thanks Greg, I had tried that one.

It turns out that this cry for help was false alarm. After days of searching the culprit turned out to be another addin that interfered with the one that contained the suspected code.
Sorry to have kept you busy.