L
livetohike
I found a great VBA macro for Word (see below) that allows me to save
to multiple locations simultaneously. I would like to do the same in
Excel. Even better would be something that auto saves (at set
interval) to multiple locations.
I tried to use the Word code in Excel, but I guess the methods are
different.
Thanks
Sub SaveToTwoLocations()
Dim strFileA As String
Dim strFileB As String
Dim strFileC As String
'Save first just to be safe
ActiveDocument.Save
strFileA = ActiveDocument.Name
'Capture the name of the current (real) doc before the 'SveAs' changes
it
strFileC = ActiveDocument.FullName
'Define backup paths
strFileB = "C:\Documents and Settings\Administrator\My Documents\Backup
\MS Word\SaveTwoLocations\" & strFileA
strFileB2 = "H:\Word Backups - SaveToTwoLocations\" & strFileA
'Save backups
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileB2
'Set the current (active) doc back to the original
ActiveDocument.SaveAs FileName:=strFileC
End Sub
to multiple locations simultaneously. I would like to do the same in
Excel. Even better would be something that auto saves (at set
interval) to multiple locations.
I tried to use the Word code in Excel, but I guess the methods are
different.
Thanks
Sub SaveToTwoLocations()
Dim strFileA As String
Dim strFileB As String
Dim strFileC As String
'Save first just to be safe
ActiveDocument.Save
strFileA = ActiveDocument.Name
'Capture the name of the current (real) doc before the 'SveAs' changes
it
strFileC = ActiveDocument.FullName
'Define backup paths
strFileB = "C:\Documents and Settings\Administrator\My Documents\Backup
\MS Word\SaveTwoLocations\" & strFileA
strFileB2 = "H:\Word Backups - SaveToTwoLocations\" & strFileA
'Save backups
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileB2
'Set the current (active) doc back to the original
ActiveDocument.SaveAs FileName:=strFileC
End Sub