ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Saving a workbook in two places. (https://www.excelbanter.com/excel-discussion-misc-queries/123625-saving-workbook-two-places.html)

Luke Slotwinski

Saving a workbook in two places.
 
I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?

Bob Phillips

Saving a workbook in two places.
 
Look at SaveCopyAs in VBA help.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Luke Slotwinski" wrote in
message ...
I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in

another
folder on another drive... is this possible?




Gord Dibben

Saving a workbook in two places.
 
Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?



Luke Slotwinski

Saving a workbook in two places.
 
Thank you for your help... That did the trick :)
Luke

"Gord Dibben" wrote:

Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?




jstro01

Saving a workbook in two places.
 
Gord

I see that this worked for the other user, however I am not familiar with
VB. So if you could give me some more direction on where this code should go.

Thanks

"Gord Dibben" wrote:

Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?




Gord Dibben

Saving a workbook in two places.
 
If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord

On Thu, 24 May 2007 14:37:23 -0700, jstro01
wrote:

Gord

I see that this worked for the other user, however I am not familiar with
VB. So if you could give me some more direction on where this code should go.

Thanks

"Gord Dibben" wrote:

Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?





jstro01

Saving a workbook in two places.
 
Thanks, this is the only line of code I can't get to work correctly.

ActiveWorkbook.SaveCopyAs FileName:="C:\My Documents\Doug Berke" & ???

I'm not sure what goes where the question marks are.

"Gord Dibben" wrote:

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord

On Thu, 24 May 2007 14:37:23 -0700, jstro01
wrote:

Gord

I see that this worked for the other user, however I am not familiar with
VB. So if you could give me some more direction on where this code should go.

Thanks

"Gord Dibben" wrote:

Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?





Gord Dibben

Saving a workbook in two places.
 
ActiveWorkbook.SaveCopyAs FileName:="C:\My Documents\Doug Berke\" _
& ActiveWorkbook.Name

Will save a copy with the same name to the Doug Berke folder.

Do you want to specify a name to save as?

Sub BUandSave2()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten if myname is duplicated
Dim myname As String
myname = InputBox("enter a name")
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\My Documents\Doug Berke\" & _
myname & ".xls"
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord


On Fri, 25 May 2007 05:40:01 -0700, jstro01
wrote:

Thanks, this is the only line of code I can't get to work correctly.

ActiveWorkbook.SaveCopyAs FileName:="C:\My Documents\Doug Berke" & ???

I'm not sure what goes where the question marks are.

"Gord Dibben" wrote:

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord

On Thu, 24 May 2007 14:37:23 -0700, jstro01
wrote:

Gord

I see that this worked for the other user, however I am not familiar with
VB. So if you could give me some more direction on where this code should go.

Thanks

"Gord Dibben" wrote:

Luke

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\yourfolderf\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Dec 2006 21:55:00 -0800, Luke Slotwinski
wrote:

I am seeking to save a workbook in two places, having the second save
automatic.
In detail: I'd like to be able to specify the save location of the Save
request, but I'd like to automatically save a copy (or a backup) in another
folder on another drive... is this possible?







All times are GMT +1. The time now is 09:03 AM.

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