Cannot edit template

  • Thread starter Thread starter MJV
  • Start date Start date
M

MJV

I’ve created many templates for staff to use. The data is entered int
Word documents via a user form in a template project.

Here’s the code in the OK command button:

Private Sub cbOK_Click()
Unload UserForm1
UserForm1.Hide
End Sub

If I attempt to edit one the templates while a user is in their ne
document, I can only open a copy. Sometimes I get the message: “thi
file is in use by another application or user.” How do I break th
hold that the new document has on the template? Or can I? thank
 
The template is not open. What's open is the newly created (from th
template) Word document.

So I reversed the order of the hide and unload statements. Tested wit
new document. The template is still held by the new document until th
user exits the _new_document_. Seems that the unload statement unload
the userform from memory, but not the entire template project
 
Hi,

This is correct the template on witch the document is based. can not b
removed out of the documents memory. (they are connected otherwise yo
would break the connection)

Yes like I mentioned before the Unload Me Statement only clears th
Form out of the memory!

Perhaps I'm not reading you're post correctly.
Do you wish to write in to the template while in another document base
upon this template?

I'm not sure what you mean? :rolleyes
 
The document created by another user from the template maintains a reference
to the template and it is because of that reference that you cannot open it.

What you should do is distribute a copy of the templates to each user and
then update those copies from a master when required by following the
procedure in the article “Distributing macros to other users” at:

http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Back
Top