PDA

View Full Version : Deploy Template to Shared folder becomes Locked



rruckus
09-16-2013, 01:06 PM
I have created a Word 2010 template with Macros (*.dotm) and want to deploy it to a group of users in my company. I want to refer to the template on a shared network folder, so I set the Word "Workgroup Templates" directory to this shared folder (\\mynetworkpath\mytemplate (file://\\mynetworkpath\mytemplate)). When a user creates a new file it works as expected and any files created from this template correctly point to the shared template file.

Now the problem is that I have made a change to the template and need to redeploy it but I cannot. When I try to overwrite the template it says it is locked. The OS says "The action can't be completed because the file is open in another program". I have 1000's of users who are logged in and using the template all the time, I can't make them manually close all Word documents that are open and related to the template!

What can I do!?

SamT
09-16-2013, 05:56 PM
you can try, in a new Document, using the OnTime Method to run a replacing sub at 3Am or whenever sounds best. In the Replace Sub use the Timer method to keep trying every 5 seconds or so, until you can open the template as a File object for Read/write. As soon as it is opened, Kill it ,then Save the Template

rruckus
09-17-2013, 08:14 AM
Thanks SamT. There will never be a time that someone is not connected to the template. My users are all around the globe in many time zones. But in your solution, I think it assumes that my users won't be connected around 3am or whenever, correct? That's unfortunately not the case. Can I disconnect the shared folder (UNSHARE IT) and then update the template and share it again? Would there be any bad side effects?

I can't be the only one who deploys Workgroup templates to lots of users! I can't find a solution on the Microsoft help or documentation. Please help!

gmaxey
09-17-2013, 12:01 PM
Perhaps you could create a log on script such that when your user's log on any templates in the WordGroup folder are copied to their local template folder and they would create their documents based on their own local copy. If you make a change then the next time they log on the changed file on in the Word Group folder replace their local copy.

This is just a suggestion and I wish I could tell "how" to write such a script. If you feel the idea has merit, I would certainly like to see how you implement it.

Jay Freedman
09-17-2013, 12:28 PM
The log-on script method is described in a little more detail in http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm.

SamT
09-17-2013, 01:18 PM
RRuckus,

Unsharing would work. I think that the only effect will be that the users can't log on until you reshare it, however, it might cause their computers to lose the shared folder permanently.

It sounds like the template is on a local Windows Desktop or Workstation computer and not on a Server OS machine. Servers are designed to automatically take care of all the side issues when updating a served file.

If it's on a Windows computer, just turn off or disconnect the modem. This will merely prevent anyone from logging on to the computer and will have no effect on any Shared folders on any machine anywhere.

rruckus
09-17-2013, 03:24 PM
Thanks guys, appreciate the help. I'll try these suggestions and respond with my results!