closing documents in 2007 versus 2003

R

Russ

The document in question was created in Word 2003. I am having a problem
running it in Word 2007. The document (Doc A) has nothing but a Start button
which runs code which does the following:
• Opens an Excel file and reads the contents into a Word VBA array
• Closes the Excel file
• Opens a second word document (Doc B) which has a table which acts as a
template for the excel data. This document contains no code. All the code
resides in Doc A
• Copies data to the template (Doc B) from the array and then copies it to
Doc A building a large 50 plus page document
• Saves Doc A with a new name Doc C
• Here is where the problem arises – The code closes Doc B without saving
the changes which should just leave Doc C, the finished document. That is
how it worked in Word 2003. However, in Word 2007 I am left with two windows
of Word. One contains the finished document Doc C. The second is labeled
Word but is blank (no file open). How do I get rid of this second blank
Word window using VBA?

It’s a little strange that if I manually close Doc C it closes but leaves
Doc B open. However, if I manually close Doc B it closes and also closes Doc
C.
 
R

Russ

small correction - the last sentence should read:
It’s a little strange that if I manually close Doc C it closes but leaves
the blank Word window open. However, if I manually close the blank Word
window it closes and also closes Doc C.
 
R

Russ

I have a bigger problem now. Suddenly it is working properly and I have no
idea why. Ignore my earlier posts on this one
 
T

Tony Jollans

Without seeing your code it is difficult to say but could this be connected
to the way you close the document and the setting of the "Windows in
Taskbar" option?
 
R

Russ

Tony,
As I said in my last email suddenly it worked correctly just as it did in
Word 2003. I did no change anything. This type of behavior scares me
because there may be something peculiar in the code and it will come back.
For the moment I am moving on. Thanks for responding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top