• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 627
  • Last Modified:

Why does this VBA code crash Word

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
Ed Matsuoka
Asked:
Ed Matsuoka
  • 3
  • 2
4 Solutions
 
GrahamSkanCommented:
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
 
Ed MatsuokaPartner/Senior IT SpecialistAuthor Commented:
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
 
GrahamSkanCommented:
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
 
Ed MatsuokaPartner/Senior IT SpecialistAuthor Commented:
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
 
Ed MatsuokaPartner/Senior IT SpecialistAuthor Commented:
Thanks for trying to help. Have a great day!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now