Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
template task pane opens when work book opens | Excel Programming | |||
Template opens in hidden window? | Excel Discussion (Misc queries) | |||
Automatically look in template folder when one opens a template | Excel Discussion (Misc queries) | |||
Template opens blank | Excel Discussion (Misc queries) | |||
Macro in template opens last saved document | Excel Programming |