ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Template Save As retains existing name!! (https://www.excelbanter.com/excel-programming/295300-template-save-retains-existing-name.html)

Brent Fidler

Template Save As retains existing name!!
 
I have a template called PkLstTemplate1.xlt saved in the template directory.

A user opens this template by clicking on a sortcut to it.
When the template opens it has a name of PkLstTemplate11 (no .xls extension)

VB code in Workbook_Open prompts the user for information
and successfully saves the file using the ActiveWorkbook.SaveAs command.
For example say the code saved the file as XYZ.xls

After the save has completed, the activeworkbook SHOULD be XYZ.xls,
but it is still PkLstTemplate11.

If the user clicks on File-Save as and gives it a new name the active
workbook becomes this new name as normal.

What am I missing? Why does the active sheet not take the name of
the file it just saved?

The code in this template used to work flawlessly every time.
For some reason it stopped working one day!

Thanks,

Brent

Anne Troy[_3_]

Template Save As retains existing name!!
 
Can't help troubleshoot code very well without the code. :(

"Brent Fidler" wrote in message
om...
I have a template called PkLstTemplate1.xlt saved in the template

directory.

A user opens this template by clicking on a sortcut to it.
When the template opens it has a name of PkLstTemplate11 (no .xls

extension)

VB code in Workbook_Open prompts the user for information
and successfully saves the file using the ActiveWorkbook.SaveAs command.
For example say the code saved the file as XYZ.xls

After the save has completed, the activeworkbook SHOULD be XYZ.xls,
but it is still PkLstTemplate11.

If the user clicks on File-Save as and gives it a new name the active
workbook becomes this new name as normal.

What am I missing? Why does the active sheet not take the name of
the file it just saved?

The code in this template used to work flawlessly every time.
For some reason it stopped working one day!

Thanks,

Brent




Dave Peterson[_3_]

Template Save As retains existing name!!
 
My guesses:

The save failed for some reason.
(Do you have an "on error resume next" masking errors?)

or the code does a .savecopyas (instead of .saveas).



Brent Fidler wrote:

I have a template called PkLstTemplate1.xlt saved in the template directory.

A user opens this template by clicking on a sortcut to it.
When the template opens it has a name of PkLstTemplate11 (no .xls extension)

VB code in Workbook_Open prompts the user for information
and successfully saves the file using the ActiveWorkbook.SaveAs command.
For example say the code saved the file as XYZ.xls

After the save has completed, the activeworkbook SHOULD be XYZ.xls,
but it is still PkLstTemplate11.

If the user clicks on File-Save as and gives it a new name the active
workbook becomes this new name as normal.

What am I missing? Why does the active sheet not take the name of
the file it just saved?

The code in this template used to work flawlessly every time.
For some reason it stopped working one day!

Thanks,

Brent


--

Dave Peterson



All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com