Solved

Why does this VBA code crash Word

Posted on 2011-02-21
5
602 Views
Last Modified: 2013-11-25
Hi experts!

I wrote this macro to break up long pages, giving each new page the title and banner information of the previous page. It works great but after anywhere from five to ten uses, it crashes Word. Why is that and how do I correct it?

Thanks! BreakBanner.txt
0
Comment
Question by:Eddie_Aeffect
  • 3
  • 2
5 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 400 total points
ID: 34945636
When you say 'crashes', what exactly happens? Do you, for instance get any error messages?

Without a suitable document, it is hard to test or to guess exactly what you are trying to do, especially with extensive use of Selection movements, but I wonder if you could achieve your objective by using the Header rows facility of Word tables. Have you tried that?



0
 

Assisted Solution

by:Eddie_Aeffect
Eddie_Aeffect earned 0 total points
ID: 34955147
What happens is that after running the macro, I will get the message that Word has encountered a problem and Word will restart trying to recover from the error. It would certanly seem to be some sort of internal memory or buffer issue but I don't know how those work. Is there a command to clear out such memory or buffer?

As far as using any Header option, I know Excel has this but I don't think Word does but it wouldn't help anyway since my "header" is not part of the table.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 400 total points
ID: 34957010
You could run the steps here in case your word installation has got itself corrupted.

http://support.microsoft.com/kb/921541

Could you consider making the data a part of the table? It could be quite different, and you needn't have borders, so that it wouldn't be seen as part of the table
Table-header.doc
0
 

Assisted Solution

by:Eddie_Aeffect
Eddie_Aeffect earned 0 total points
ID: 35012101
Hi GrahamSkan!

I put in a couple of lines of code that clear out the revisions and now it is not crashing. So I am good. Thanks for responding so quickly.
0
 

Author Closing Comment

by:Eddie_Aeffect
ID: 35045670
Thanks for trying to help. Have a great day!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now