Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Templates not loading as xls version

Hi Folks,
I have created a p'word protected xlt workbook. When I open the file from
windows explorer it will open as an xls 'version' as it should. However most
users will use the excel file-open options to get the file which means it
stays as a template.
Can anyone help me out with some some VBA which is beyond my current
knowledge?

As soon as the template is loaded as read only I would like the file to
automatically remove the password and prompt the user to re-save under a new
name using the xls extension (selected for them as the save-as window stays
on xlt).

Hope this makes sense. Can this be done?
Your help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Templates not loading as xls version

Possibly:

Code to open new workbook:
'open a new workbook from the .xlt
Workbooks.Add Template:="FullPathAndFilenameIncluding.xlt"
'this will be named whatever the workbook.xlt name is with a number suffix
added to it. The ".xls" extension will be added by Excel automatically.
'remove protection
ActiveWorkbook.Unprotect Password:="ThePassword"
'prompt user to save
Application.Dialogs(xlDialogSaveAs).Show
'the dialog will automatically filter ".xls" as the default file extension

If the workbook.xlt contains a single sheet, and you wish to 'Insert' that
sheet into an existing workbook, then replace the "Workbooks.Add..." line
with:

Worksheets.Add Type:="FullPathAndFilenameIncluding.xlt"

I'm not clear on why the protection is used, to only remove it right off the
bat and save the workbook unprotected.

Good luck!
GS
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Templates not loading as xls version

Thanks GS,
I'll take a look into the dialogue coding.
To answer your questions:
Protection is on to stop the template workbook being tampered with.
However, leaving protection (with p/w) on will stop the user from hiding
unwanted columns - a definate requirement.
A default .xls save is needed because any .xlt file opened through the Excel
"file-open" stays as a template and I can already envision users renaming but
failing to spot the file type as .xlt

"GS" wrote:

Possibly:

Code to open new workbook:
'open a new workbook from the .xlt
Workbooks.Add Template:="FullPathAndFilenameIncluding.xlt"
'this will be named whatever the workbook.xlt name is with a number suffix
added to it. The ".xls" extension will be added by Excel automatically.
'remove protection
ActiveWorkbook.Unprotect Password:="ThePassword"
'prompt user to save
Application.Dialogs(xlDialogSaveAs).Show
'the dialog will automatically filter ".xls" as the default file extension

If the workbook.xlt contains a single sheet, and you wish to 'Insert' that
sheet into an existing workbook, then replace the "Workbooks.Add..." line
with:

Worksheets.Add Type:="FullPathAndFilenameIncluding.xlt"

I'm not clear on why the protection is used, to only remove it right off the
bat and save the workbook unprotected.

Good luck!
GS

  #4   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Templates not loading as xls version

Ok, so the protection is to preserve the integrity of the template. My
curiosity is satisfied, ..thanks for the feedback!

Regards,
GS

"Gizmo63" wrote:

Thanks GS,
I'll take a look into the dialogue coding.
To answer your questions:
Protection is on to stop the template workbook being tampered with.
However, leaving protection (with p/w) on will stop the user from hiding
unwanted columns - a definate requirement.
A default .xls save is needed because any .xlt file opened through the Excel
"file-open" stays as a template and I can already envision users renaming but
failing to spot the file type as .xlt

"GS" wrote:

Possibly:

Code to open new workbook:
'open a new workbook from the .xlt
Workbooks.Add Template:="FullPathAndFilenameIncluding.xlt"
'this will be named whatever the workbook.xlt name is with a number suffix
added to it. The ".xls" extension will be added by Excel automatically.
'remove protection
ActiveWorkbook.Unprotect Password:="ThePassword"
'prompt user to save
Application.Dialogs(xlDialogSaveAs).Show
'the dialog will automatically filter ".xls" as the default file extension

If the workbook.xlt contains a single sheet, and you wish to 'Insert' that
sheet into an existing workbook, then replace the "Workbooks.Add..." line
with:

Worksheets.Add Type:="FullPathAndFilenameIncluding.xlt"

I'm not clear on why the protection is used, to only remove it right off the
bat and save the workbook unprotected.

Good luck!
GS

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
How do I save an Excel 97-2003 version or 2007 version for Mac 200 Bronigal Excel Discussion (Misc queries) 1 December 7th 09 08:04 AM
saved templates opening as templates 4n6DNA Excel Discussion (Misc queries) 2 August 31st 09 09:30 PM
Wrap Text: Print Version different than Screen Version sh2195 Excel Discussion (Misc queries) 0 August 25th 08 03:52 PM
Excel is opening templates as templates instead of as worksheets Desram Setting up and Configuration of Excel 1 January 19th 06 09:38 PM
Recover earlier version of excel sheet after new version saved? stephanie38 Excel Discussion (Misc queries) 3 June 17th 05 03:52 AM


All times are GMT +1. The time now is 01:03 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"