PDA

View Full Version : Solved: readonly normal.dot on network drive



suji
02-08-2010, 03:46 AM
Hi,

Is there a way to create global macros which can be executed from any document without saving in normal.dot because at work my normal.dot is readonly on a network drive.

Thanks
Suji

lucas
02-08-2010, 08:03 AM
Save your code in a template eg. Novel.dot. Move that template to your Startup folder eg. C:\Program Files\Microsoft Office\Office\Startup

fumei
02-08-2010, 10:50 AM
Global templates do not have to be in Startup. They can be anywhere. In fact, IMO, it is better to have a global template (acting as a code container - macros) NOT in Startup.

Yes, there should be a global in Startup, but it can act as a load-in, load-out for the real code container.

This is what I do:

In everyone's Startup, a wee .DOT. It does one thing, and one thing only. It places an icon/button on a toolbar. The button toggles the main code container (the global template) in and out.

The reaosn for this, is that if the actual code container (the global with all the macros) is in Startup, that means THAT file has to be maintained over as many people (computers) that use it. This may, or may not, be an issue.

However, if the Startup (which loads automatically on...Startup), is very simple:
Sub LoadVBA_DOT()
Dim myAddin As AddIn
For Each myAddin In AddIns
If myAddin.Name = "VBA XTools.dot" Then
AddIns("X:\Gerry\MyTemplates\VBA XTools.dot").Installed = False
AddIns("X:\Gerry\MyTemplates\VBA XTools.dot").Delete
GoTo MyEnd:
End If
Next
AddIns.Add "X:\Gerry\MyTemplates\VBA XTools.dot", Install:=True
MyEnd:
End Sub
then it really needs little (if any) maintainence. The above is on the toolbar as "Load Macros".

It is a toggle. Clicked, it checks to see if the gloabl IS loaded, if it is, unload it. If it is not, load it. Simple.

The actual global containers literally hundreds of macros/procedures is at:

X:\Gerry\MyTemplates\VBA XTools.dot

A network location. So only ONE file needs to be maintained. Further, there is no need to have any other scripting to make sure that global is download to everyone's Startup. Just that one wee one that calls the actual code gloabl.

There is nothing wrong with having your global in everyone's Startup. It really depends on how many computers are involved, how easy it may be to maintain (if your global's macros change rarely, then it is not so important).

Generally speaking it is NOT a good idea to have macros in normal.dot. Even Microsoft recommends against this.

suji
02-09-2010, 11:11 PM
Thankyou