Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
I am using the office 2000 package. Can anyone tell me how I can open a .xlt
file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
Here is the code that I use to opne a template called "TreeTemplate.xls". I
keep the template in the same folder as the workbook that calls the code. The xls file should be closed when the cjode is run. strCurrentExcelPath = ActiveWorkbook.Path 'assign path information Workbooks.Open Filename:= _ strCurrentExcelPath & "\TreeTemplate.xlt", Editable:=True 'open template for new file Stan Shoemaker Palo Alto, CA "IXLINXL" wrote: I am using the office 2000 package. Can anyone tell me how I can open a .xlt file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
Are you asking how to create a new workbook based on a template?
workbooks.add template:="C:\myworkbook.xlt" === It's not usually necessary to post to multiple newsgroups. But if you're going to do it, it would be better to cross post (include all the newsgroups in your header) and post it once. Multiposting (sending separate posts to separate newsgroups) does make it more difficult for you (to consolidate all the responses), and can duplicate effort. (And the part that I'd hate--You don't get the best combined response--someone sees an answer that can be made better/different.) IXLINXL wrote: I am using the office 2000 package. Can anyone tell me how I can open a .xlt file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
Sorry about the multiple post....
I guess I need to try and be clearer on my question. I have created an electronic expense claim. It has a bunch of neat functionality like an email button that when pressed emails a copy to their supervisor and a save button that saves a copy to the users "my documents' folder. Anyway it built on an Excel template that over 100 people access from a shared drive. Inside the template itself there is a Control sheet that contains data that needs to be updated weekly. I am training to build some code that will open the template itself so that I can modify it and then save it again so that the next day anyone who uses it will have all of the latest data. Here is another description of what I am trying to do. I want to use code to do the same thing that happens when you right click on an .xlt file and then click "open". It opens the template itself and not an instance of it. Is that a more clear explanation? "Dave Peterson" wrote: Are you asking how to create a new workbook based on a template? workbooks.add template:="C:\myworkbook.xlt" === It's not usually necessary to post to multiple newsgroups. But if you're going to do it, it would be better to cross post (include all the newsgroups in your header) and post it once. Multiposting (sending separate posts to separate newsgroups) does make it more difficult for you (to consolidate all the responses), and can duplicate effort. (And the part that I'd hate--You don't get the best combined response--someone sees an answer that can be made better/different.) IXLINXL wrote: I am using the office 2000 package. Can anyone tell me how I can open a .xlt file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
Dave-
I misunderstood your original question. To open the template file itself, you want to add the argument "Editable = True" to the Workbooks.Open statement. e.g. Workbooks.Open Filename:= _ "C:\PathName\MyTemplate.xlt", Editable:=True Stan Shoemaker Palo Alto, CA "IXLINXL" wrote: Sorry about the multiple post.... I guess I need to try and be clearer on my question. I have created an electronic expense claim. It has a bunch of neat functionality like an email button that when pressed emails a copy to their supervisor and a save button that saves a copy to the users "my documents' folder. Anyway it built on an Excel template that over 100 people access from a shared drive. Inside the template itself there is a Control sheet that contains data that needs to be updated weekly. I am training to build some code that will open the template itself so that I can modify it and then save it again so that the next day anyone who uses it will have all of the latest data. Here is another description of what I am trying to do. I want to use code to do the same thing that happens when you right click on an .xlt file and then click "open". It opens the template itself and not an instance of it. Is that a more clear explanation? "Dave Peterson" wrote: Are you asking how to create a new workbook based on a template? workbooks.add template:="C:\myworkbook.xlt" === It's not usually necessary to post to multiple newsgroups. But if you're going to do it, it would be better to cross post (include all the newsgroups in your header) and post it once. Multiposting (sending separate posts to separate newsgroups) does make it more difficult for you (to consolidate all the responses), and can duplicate effort. (And the part that I'd hate--You don't get the best combined response--someone sees an answer that can be made better/different.) IXLINXL wrote: I am using the office 2000 package. Can anyone tell me how I can open a .xlt file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a template .xls with VBA code
Thank-You, It seems so simple now :0)
"stanshoe" wrote: Dave- I misunderstood your original question. To open the template file itself, you want to add the argument "Editable = True" to the Workbooks.Open statement. e.g. Workbooks.Open Filename:= _ "C:\PathName\MyTemplate.xlt", Editable:=True Stan Shoemaker Palo Alto, CA "IXLINXL" wrote: Sorry about the multiple post.... I guess I need to try and be clearer on my question. I have created an electronic expense claim. It has a bunch of neat functionality like an email button that when pressed emails a copy to their supervisor and a save button that saves a copy to the users "my documents' folder. Anyway it built on an Excel template that over 100 people access from a shared drive. Inside the template itself there is a Control sheet that contains data that needs to be updated weekly. I am training to build some code that will open the template itself so that I can modify it and then save it again so that the next day anyone who uses it will have all of the latest data. Here is another description of what I am trying to do. I want to use code to do the same thing that happens when you right click on an .xlt file and then click "open". It opens the template itself and not an instance of it. Is that a more clear explanation? "Dave Peterson" wrote: Are you asking how to create a new workbook based on a template? workbooks.add template:="C:\myworkbook.xlt" === It's not usually necessary to post to multiple newsgroups. But if you're going to do it, it would be better to cross post (include all the newsgroups in your header) and post it once. Multiposting (sending separate posts to separate newsgroups) does make it more difficult for you (to consolidate all the responses), and can duplicate effort. (And the part that I'd hate--You don't get the best combined response--someone sees an answer that can be made better/different.) IXLINXL wrote: I am using the office 2000 package. Can anyone tell me how I can open a .xlt file via code? The methods I have tried all seem to open the .xlt and an instance of itself and open up as a .xls file? BTW I have posted a similar question on another newsgroup(with no luck so far). As soon as I get find a solution I will be sure to update both groups as to avoid potentially duplicate efforts. Thanks, IXLINXL - not -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening files with a template | Excel Discussion (Misc queries) | |||
Template opening | Excel Discussion (Misc queries) | |||
Opening a new file from a template | Excel Programming | |||
Opening Template | Excel Programming | |||
Opening a Worksheet from a template | Excel Programming |