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)
- Difference between Visual Basic 6.0 and VBA +122 (2009)
- VBA – how to conditionally skip a for loop iteration +116 (2011)
- VBA: Test if string begins with a string? +53 (2013)
- html parsing of cricinfo scorecards +47 (2012)
- Code to loop through all records in MS Access +46 (2011)
- Access VBA | How to replace parts of a string with another string +44 (2011)
vba solutions on this site
.