"This document cannot be closed ..." it is referenced ...

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

"This document cannot be closed ..." it is referenced ...

Post by ChrisGreaves »

Word2003: I can't recall meeting this before. My project is developed in a MSWord document "ESE_05.doc".
To save time I have used Tools, Reference to point to an earlier project "MM20211115.doc".

While I am running my project, "MM20211115.doc" is opened, so at the end of the day I have two documents open on the laptop.

I use the keyboard Alt-File, eXit to shutdown MSWord, and receive the pop-up message shown below.
Untitled.png
Just another excuse to dash off a bit more VBA in the referenced document MM20211115.doc"", right?

Code: Select all

Private Sub Document_Close()
    If UW.blnDocIsOpen("ESE_05.doc") Then
        Documents("ESE_05.doc").Close
    Else
    End If
End Sub
That will do for the next couple of weeks, then all the project code is merged.
But does anyone have a neater, generalized way of coping with this situation?

Thanks
Chris
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.