Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Incorrect templates path

Hello,
I have a VB6, Excel/Word VBA app that runs in Excel and uses the
Application.TemplatesPath property to locate where the templates I created
and stored are-this is the same folder where the standard Word and Excel
templates are located. It works fine under Win XP pro and Office 2003, but in
a testbed under Virtual PC 2004 that is Win 98, Office 97 it grabs the wrong
location.
The correct location under that system should be:
C:\Windows\Application Data\Microsoft\Templates\
but instead it grabs:
C:\Program Files\Microsoft Office\Templates\
This was originally developed under Office 97 before I upgraded and I
believe I used the same code and it worked before.
Any ideas on what the problem is and how to resolve this?
Thanks, God bless
Van
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Incorrect templates path

Van -

FWIW, I always store all the files for a given app in the same
directory. Any VB exe, the Excel add-in or workbook, any templates for
Excel, Word, PowerPoint; everything is placed by the installer into:

C:\Program Files\My Program\

This works fine, since my templates are rarely used directly by the user.

That's kind of OT to your post. When investigating VPC last year, I
recall some grumbling about things like default paths. Maybe you could
also ask this question in 'microsoft.public.virtualpc'.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

VanS wrote:

Hello,
I have a VB6, Excel/Word VBA app that runs in Excel and uses the
Application.TemplatesPath property to locate where the templates I created
and stored are-this is the same folder where the standard Word and Excel
templates are located. It works fine under Win XP pro and Office 2003, but in
a testbed under Virtual PC 2004 that is Win 98, Office 97 it grabs the wrong
location.
The correct location under that system should be:
C:\Windows\Application Data\Microsoft\Templates\
but instead it grabs:
C:\Program Files\Microsoft Office\Templates\
This was originally developed under Office 97 before I upgraded and I
believe I used the same code and it worked before.
Any ideas on what the problem is and how to resolve this?
Thanks, God bless
Van

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Incorrect templates path

Jon,
A delayed thanks for your helpful reply.
I am thinking perhaps your solution is simplest solution and to just put my
Word and Excel templates in my Program Files\Application
folder. I have Word templates and also Excel workbook and worksheet
templates. For the Word .dot and Excel Workbook templates I can then set the
path in the code. The only problem I am having now is trying to use the add
method of the Worksheet to add the worksheet template to a workbook.
The MS website doesn't give very specific instructions for adding a sheet as
a template. I have tried to add from my template after the last sheet such
as:
Worksheets.Add.Move (after:=
Worksheets(Worksheets.Count),Type:="C:\Path\TEmpla teName.xlt")
and also
Worksheets.Add.Move Type:="C:\Path\TEmplateName.xlt"

However, I get error Application-defined or object-defined error message.
Any idea what the right syntax is to get this done.
Thanks again,
Van



"Jon Peltier" wrote:

Van -

FWIW, I always store all the files for a given app in the same
directory. Any VB exe, the Excel add-in or workbook, any templates for
Excel, Word, PowerPoint; everything is placed by the installer into:

C:\Program Files\My Program\

This works fine, since my templates are rarely used directly by the user.

That's kind of OT to your post. When investigating VPC last year, I
recall some grumbling about things like default paths. Maybe you could
also ask this question in 'microsoft.public.virtualpc'.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

VanS wrote:

Hello,
I have a VB6, Excel/Word VBA app that runs in Excel and uses the
Application.TemplatesPath property to locate where the templates I created
and stored are-this is the same folder where the standard Word and Excel
templates are located. It works fine under Win XP pro and Office 2003, but in
a testbed under Virtual PC 2004 that is Win 98, Office 97 it grabs the wrong
location.
The correct location under that system should be:
C:\Windows\Application Data\Microsoft\Templates\
but instead it grabs:
C:\Program Files\Microsoft Office\Templates\
This was originally developed under Office 97 before I upgraded and I
believe I used the same code and it worked before.
Any ideas on what the problem is and how to resolve this?
Thanks, God bless
Van


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
Disable spreadsheet when copied to incorrect file path or differen ip address Schatzi Excel Discussion (Misc queries) 4 April 29th 11 02:58 PM
Excel Templates Path Question DawnTreader Excel Discussion (Misc queries) 9 January 17th 07 11:57 PM
Excel 2003 link path is incorrect rykkim Setting up and Configuration of Excel 0 January 13th 06 07:02 PM
Macros i xla-files get incorrect path Roffe Excel Programming 1 April 20th 04 05:04 PM
Finding out the workgroup templates path Steven Excel Programming 1 February 3rd 04 11:39 AM


All times are GMT +1. The time now is 02:16 PM.

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

About Us

"It's about Microsoft Excel"