Creating a new Excel File based on a template in VBA

calendar_today Asked Feb 6, 2012
thumb_up 13 upvotes
history Updated April 16, 2026

Question posted 2012 · +3 upvotes

I am building an application in Excel which will enable a user to select from a list of existing excel based tools that have been built. They will select the specific tool and hit a “create new” button. Upon clicking this button, the user will be asked to name the file. After entering the name, a new workbook needs to be created and placed in that specific tool’s project folder. I am having trouble implementing this in code. I have been able to find examples of code implementing copying templates from the active workbook, but nothing for creating something that is in another excel file entirely.

I believe I need to make a copy of the workbook that the user needs to recreate and then change the name and place the file in the desired location.

I would post some code to show what I’ve done so far, but I haven’t really made progress.

Thanks,

Accepted answer +13 upvotes

set wb = workbooks.add("x:mytemplate.xls") allows you to create a NEW doc and specify the file to be used as a template.

Top vba Q&A (6)

+13 upvotes ranks this answer #32 out of 81 vba solutions on this site .
vba