Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening files with a template enyaw Excel Discussion (Misc queries) 0 July 10th 07 10:24 AM
Template opening Galliano Excel Discussion (Misc queries) 3 April 7th 06 05:00 PM
Opening a new file from a template Mick Southam Excel Programming 5 July 30th 04 10:21 PM
Opening Template Srinath Excel Programming 2 August 28th 03 04:05 PM
Opening a Worksheet from a template Taher Baderkhan Excel Programming 1 August 11th 03 08:25 PM


All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"