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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening template

Status
Not open for further replies.

VBAva

Programmer
Jul 29, 2003
87
IE
Hello
I am having a little trouble with opening up a template, well the template opens but then does not go on to the next line of code.
i have simplified it down to this, the message boxes were to check if there are values in the variables. the first message box display is right (file path stored in the worksheet), and then the template is opened as a new file, but then it just stops. the next message box is not displayed, and no matter what the next line of code is, it is not done!

after the template is opened i need to go on to copy values into it automatically, but the code stops for no reason.

Public Sub OpenTemplate()
TemplateFileName = Sheets("WorkbookInfo").Range("TemplateName").Value
MsgBox TemplateFileName
Workbooks.Add Template:=TemplateFileName
FileTemplate = ActiveWorkbook.name
MsgBox FileTemplate
End Sub

anyone have ANY ideas at all???
cheers
 
Hi VBAva,

I don't know a huge amount about Excel templates but I didn't have any problems when I tried it with a random template. Might there be something in the template which is causing the problem? Does it work with a different template?

Enjoy,
Tony
 
i did not try with any other templates.

i have actually found my way around it and have used code to copy modules and code into the new file, this is want i was originaly going to do but was not sure how.

thanks anyway :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top