Here are some similar macros I've collected. Maybe you can find something useful in them:
Saving in Multiple Locations http://excel.tips.net/T002774_Saving_in_Multiple_Locations.html
Saving in Multiple Locations
If the drive letter assigned to your USB drive is always the same, you can use code like the following in the ThisWorkbook module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.EnableEvents = False
ThisWorkbook.Save
ThisWorkbook.SaveCopyAs "J:" & ThisWorkbook.Name
Application.EnableEvents = True
End Sub
Change the "J" to the appropriate drive letter.
If the drive letter may change but the volume label is always the same, use code like the following in the ThisWorkbook code module:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim DriveLetter As String
Dim VolumeName As String
On Error Resume Next
Application.EnableEvents = False
ThisWorkbook.Save
VolumeName = "YourVolumeName"
DriveLetter = GetDriveLetter(VolumeName)
If Len(DriveLetter) > 0 Then
ThisWorkbook.SaveCopyAs DriveLetter & ":" & ThisWorkbook.Name
End If
Application.EnableEvents = True
End Sub
Private Function GetDriveLetter(VolumeName As String) As String
Dim FSO As Object
Dim DD As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each DD In FSO.Drives
If DD.IsReady = True Then
If StrComp(DD.VolumeName, VolumeName, vbTextCompare) = 0 Then
GetDriveLetter = DD.DriveLetter
Exit Function
End If
End If
Next DD
End Function
Change VolumeName to the appropriate volume name.
In the last issue of WordTips there were a number of readers that got the idea that I was suggesting that people should use the FastSave feature. In fact, I got quite a bit of feedback on that tip, some of it quite pointed. (According
to one reader, I was even “irresponsible.” Another stated that I was doing a disservice to readers.)
I am sorry if I gave the impression that I thought FastSave is a great idea. That is far from the truth; I do not. There are several other “features” of Word that I think are ill conceived or totally unnecessary, as well. It doesn’t change
the fact that they are features and people can use them, if they desire. WordTips are not designed to promote one method of doing something over another, but to provide alternative ideas that people can incorporate into their Word use, if they so desire.
With that being said, let me point out specifically why you should
not use the FastSave feature.
- Other word processors may not be able to open Word documents saved with the FastSave feature enabled. For instance, WordPerfect says it can open Word documents, yet some versions of WordPerfect
cannot open FastSaved Word documents.
- Third-party software designed to work with Word documents (such as some grammar checkers, document management programs, and desktop publishing software) will not work correctly with FastSaved
Word documents.
- Find File (either in Word or in Windows) may not work correctly with FastSaved Word documents.
- FastSave results in more complex files being saved on disk. Any time you increase complexity, you run the risk of corrupting the files easier.
- FastSaved files take up more disk space.
- There have been reports of macro viruses “living on” in FastSaved documents, even though you thought you had them removed.
The list could go on and on, but you get the idea. In short, unless you have a specific need to use FastSave (such as if you are only creating simple documents using Word 6 on a slow 286 machine), it is probably a good idea to turn it
off. The FastSave feature is turned on by default in all versions of Word, even in the original Word 97. Only if you are using Word 97 SR-1 is it turned off by default.
As a side note, according to the Microsoft Knowledge Base there are several circumstances under which a FastSave is not done by Word, even if you have enabled the feature. These circumstances include the following:
- When you save a document for the first time. (This makes sense, right?) This includes when you choose Save As to save under a new name or in a new location.
- When your document is saved on a network server or remote volume. (Word only performs a FastSave to a local volume.)
- When Word reaches the limit of how much information it can save using the FastSave option. In this case Word does a normal save, and then again starts using FastSave for future saves.
Nuff said? (I hate it when I’m irresponsible.)
Excel- Saving in Two Locations
http://excel.tips.net/T003042\_Saving\_in\_Two\_Locations.html
Save the current document in two locations add-in for Word 2007 & 2010 -http://www.gmayor.com/SaveInTwoPlacesAddIn.htm