Solved

Why does this VBA code crash Word

Posted on 2011-02-21
5
612 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

856 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