Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Template opens instead of copy

Hi,

I have a template in a TEMPLATE folder on a network drive.
I could open this with a shortcut, and a copy of the template opened
as expected.
Because some settings could change (worksheet in the template), i made
it possible to save the template with the code below (Private Sub
CommandButton1_Click() )

I did make some changes in the setting and saved the template.
From then on started the problem that the template itself opens
instead of a copy.

I'm running on Win XP Professional Version 2002 SP2 & Office 2003 SP3.

Here's the macro to open the template on the network drive.

Sub OpenHassOpvolgblad()

ChDir "\\bvwsrv01\BVW\AV\Operations\HASS\2.Utility and Log file"
Workbooks.Open FileName:="\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt", Editable:=False,
Notify:=False
End Sub

In my template i have following code:

Public Const UtilityTemplatePath = "\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt"

Private Sub CommandButton1_Click()
' save settings
Application.DisplayAlerts = False
ThisWorkbook.SaveAs FileName:=UtilityTemplatePath
Unload Me
End Sub


Any clue what could have gone wrong, or is the above commandbutton
code the origine of the problem?
Any help welcome.

Ludo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Template opens instead of copy

I'd just create a new workbook based on that template:

Dim NewWkbk As Workbook

set NewWkbk _
= workbooks.Add(template:="\\bvwsrv01\BVW\AV\Operati ons\HASS" _
& "\2.Utility and Log file\Templates\HASS.xlt")



On 08/31/2010 08:23, Ludo wrote:
Hi,

I have a template in a TEMPLATE folder on a network drive.
I could open this with a shortcut, and a copy of the template opened
as expected.
Because some settings could change (worksheet in the template), i made
it possible to save the template with the code below (Private Sub
CommandButton1_Click() )

I did make some changes in the setting and saved the template.
From then on started the problem that the template itself opens
instead of a copy.

I'm running on Win XP Professional Version 2002 SP2& Office 2003 SP3.

Here's the macro to open the template on the network drive.

Sub OpenHassOpvolgblad()

ChDir "\\bvwsrv01\BVW\AV\Operations\HASS\2.Utility and Log file"
Workbooks.Open FileName:="\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt", Editable:=False,
Notify:=False
End Sub

In my template i have following code:

Public Const UtilityTemplatePath = "\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt"

Private Sub CommandButton1_Click()
' save settings
Application.DisplayAlerts = False
ThisWorkbook.SaveAs FileName:=UtilityTemplatePath
Unload Me
End Sub


Any clue what could have gone wrong, or is the above commandbutton
code the origine of the problem?
Any help welcome.

Ludo


--
Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Template opens instead of copy

On 31 aug, 16:02, Dave Peterson wrote:
I'd just create a new workbook based on that template:

* * *Dim NewWkbk As Workbook

* * *set NewWkbk _
* * * *= workbooks.Add(template:="\\bvwsrv01\BVW\AV\Operati ons\HASS" _
* * * * * * *& "\2.Utility and Log file\Templates\HASS.xlt")

On 08/31/2010 08:23, Ludo wrote:





Hi,


I have a template in a TEMPLATE folder on a network drive.
I could open this with a shortcut, and a copy of the template opened
as expected.
Because some settings could change (worksheet in the template), i made
it possible to save the template with the code below (Private Sub
CommandButton1_Click() )


I did make some changes in the setting and saved the template.
*From then on started the problem that the template itself opens
instead of a copy.


I'm running on Win XP Professional Version 2002 SP2& *Office 2003 SP3..


Here's the macro to open the template on the network drive.


Sub OpenHassOpvolgblad()


* * *ChDir "\\bvwsrv01\BVW\AV\Operations\HASS\2.Utility and Log file"
* * *Workbooks.Open FileName:="\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt", Editable:=False,
Notify:=False
End Sub


In my template i have following code:


Public Const UtilityTemplatePath = "\\bvwsrv01\BVW\AV\Operations\HASS
\2.Utility and Log file\Templates\HASS.xlt"


Private Sub CommandButton1_Click()
' save settings
* * *Application.DisplayAlerts = False
* * *ThisWorkbook.SaveAs FileName:=UtilityTemplatePath
* * *Unload Me
End Sub


Any clue what could have gone wrong, or is the above commandbutton
code the origine of the problem?
Any help welcome.


Ludo


--
Dave Peterson- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -


Thanks Dave, this works.

Ludo
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
template task pane opens when work book opens outrigger Excel Programming 0 April 19th 10 03:16 PM
Template opens in hidden window? ktlasers Excel Discussion (Misc queries) 0 October 4th 07 09:30 PM
Automatically look in template folder when one opens a template hmm Excel Discussion (Misc queries) 0 July 11th 07 04:26 PM
Template opens blank Deborah Zotian - MOS Excel Discussion (Misc queries) 2 November 16th 05 08:55 PM
Macro in template opens last saved document smoenra Excel Programming 2 July 1st 04 01:56 PM


All times are GMT +1. The time now is 05:41 PM.

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"