Solved

Why does this VBA code crash Word

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

746 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

11 Experts available now in Live!

Get 1:1 Help Now