ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with save as coed (https://www.excelbanter.com/excel-programming/304419-help-save-coed.html)

Paul B[_7_]

Help with save as coed
 
We are in the process of upgrading computers at my work, windows xp and
excel 2003, I am trying to get a macro to save the workbook as a template,
with windows 98 it saved to the same place, but with windows xp it looks
like it is getting the computers name as part of the save, the code below
was recorded on two of the computers ,is there anyway to write a macro that
will work on all the computers? Most of the people here have a limited
experience with excel and this file needs to be saved as a template after
they have put in there setup data, so I was wanting to put a button on the
sheet to save it as a template, put a shortcut on the desktop and delete
this button, I have code for the shortcut and to delete the button, but I
don’t know how to make it so the save will work on all of the computers.
Thanks

Paul B


Sub Macro1()
ChDir "C:\Documents and Settings\electric\Application
Data\Microsoft\Templates"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\electric\Application
Data\Microsoft\Templates\Time Sheet.xlt" _
, FileFormat:=xlTemplate, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

Sub Macro2()
ChDir _
"C:\Documents and Settings\carpentry\Application
Data\Microsoft\Templates"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\carpentry\Application
Data\Microsoft\Templates\Time Sheet.xlt" _
, FileFormat:=xlTemplate, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub



Jim Rech

Help with save as coed
 
If you want to save the active workbook as a template to the same location
as the active workbook you might try code like this:

ActiveWorkbook.SaveAs Replace(ActiveWorkbook.FullName, ".xls", ""),
xlTemplate

--
Jim Rech
Excel MVP
"Paul B" wrote in message
...
| We are in the process of upgrading computers at my work, windows xp and
| excel 2003, I am trying to get a macro to save the workbook as a template,
| with windows 98 it saved to the same place, but with windows xp it looks
| like it is getting the computers name as part of the save, the code below
| was recorded on two of the computers ,is there anyway to write a macro
that
| will work on all the computers? Most of the people here have a limited
| experience with excel and this file needs to be saved as a template after
| they have put in there setup data, so I was wanting to put a button on the
| sheet to save it as a template, put a shortcut on the desktop and delete
| this button, I have code for the shortcut and to delete the button, but I
| don’t know how to make it so the save will work on all of the computers.
| Thanks
|
| Paul B
|
|
| Sub Macro1()
| ChDir "C:\Documents and Settings\electric\Application
| Data\Microsoft\Templates"
| ActiveWorkbook.SaveAs Filename:= _
| "C:\Documents and Settings\electric\Application
| Data\Microsoft\Templates\Time Sheet.xlt" _
| , FileFormat:=xlTemplate, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
| End Sub
|
| Sub Macro2()
| ChDir _
| "C:\Documents and Settings\carpentry\Application
| Data\Microsoft\Templates"
| ActiveWorkbook.SaveAs Filename:= _
| "C:\Documents and Settings\carpentry\Application
| Data\Microsoft\Templates\Time Sheet.xlt" _
| , FileFormat:=xlTemplate, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
| End Sub
|
|




All times are GMT +1. The time now is 08:14 AM.

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