(Solved) – Inserting a template using a macro in Excel


I’m having trouble inserting an excel template into a program. My intent is to press a button on the main file which will insert a sheet. This program will be used by everyone in the office, so I’d like to be able to save the XLTM files in a common folder on our server, preferably with the main program.

The program runs fine, but I don’t want everyone to have to save the XLTM files in their appdata>Microsoft>Roaming>Templates folder if they want to use it.

My code is as follows:

'name of the sheet template
    shName = "Wet Systems Template.xltm"

    'Insert sheet template

With ThisWorkbook
        Set sh = Sheets.Add(Type:=Application.TemplatesPath & shName, _

    End With

How can I modify this code to specify a particular location on our file server?

Thank you,

Leave a Reply

Your email address will not be published. Required fields are marked *