Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Add-in having templates

Status
Not open for further replies.

mdgabe

Technical User
Sep 7, 2006
12
US
I created a nice add-in that is used by my colleagues, I also created a two tab template that is used by my colleagues. Is there a way to put the template inside my add-in, so when the user selects that option, it would insert the two tab template inside the active workbook?
 
Sure something like:
Code:
Sub InsertTemplateSheets()
    Workbooks.Open Filename:="[!]TemplateFileNameAndPathHere[/!]"
    Sheets("[!]TemplateSheet1[/!]").Copy Before:=Workbooks("Book1").Sheets(1)
     Sheets("[!]TemplateSheet2[/!]").Copy Before:=Workbooks("[!]Book1[/!]").Sheets(1)
    Windows("[!]TemplateFileName[/!].xls").Activate
    ActiveWindow.Close
End Sub

You will need to change the items in red to match your actual situation.
Hope this helps.
Tom

Born once die twice; born twice die once.
 
That's good if you wanted to distribute the add-in and the template separately, but I want to bundle them together, so the template sheets are within my add-in. Is that possible?
Thanks for your prompt reply!
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top