Setting NetworkTemplatesPath programmatically in Excel 2000 VBA


Ladislav Ligart

I just spent hours searching this group on this issue and came up with
a way of setting it programmatically in Excel VBA, and am posting it
here in hopes no one else has to spend hours searching. :)

Excel 2000's NetworkTemplatesPath property is Read-only and you can't
set it in VBA.

You can either hack the Registry (so I'm told), or simply go into Word
and choose Tools / Options / File Locations and set "Workgroup
templates" path. Excel will then use this value for its "Network
Templates Path"

Programmatically access Word's object model in Excel and set Word's
"Workgroup templates" path. This works for for Office 2000, not sure
about the rest.


Sub SetNetworkTemplatesPath()
' Purpose:
' Set Excel's NetworkTemplatesPath by way of setting
' Word's WorkgroupTemplatesPath

'// Must check Tools / References / Microsoft Word 9.0 Object Library
Dim oWord As Object
Set oWord = New Word.Application

'// see what Excel has to begin with
MsgBox ("Excel's Network Path Was: " & _
vbCrLf & Application.NetworkTemplatesPath)

'// set Word's path to your LAN path
oWord.Options.DefaultFilePath(wdWorkgroupTemplatesPath) = _

'// Excel follows suit!
MsgBox ("Excel's Network Path Is: " & _
vbCrLf & Application.NetworkTemplatesPath)

End Sub


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