simultaneous file saving

Microsoft Ms oem office basic 2007 v2
February 12, 2010 at 12:31:15
Specs: Windows Vista
I need a way to save an EXCL or WORD file on both my Hard Drive, and flash drive (as back-uo) without constantly having to browse to each target subdirectory.

Now, in say EXCEL, when I save to Hard Drive, it remembers that location, but then I have to SAVE AS to save again on the flash drive, and browse to THAT folder location, an so on.

See More: simultaneous file saving

Report •

February 12, 2010 at 13:20:58

How about a macro that saves the file twice.

This is a skeleton code that save a word document to two locations - the removable first then the fixed drive.

It asks for a filename, uses the existing file extension, or if none, a default .doc

The two paths are hardcoded.

There are lots of possibilities such as adding a file finder dialog box for the second save after saving the first time to a memory stick.
If the file had already been saved, you could just do the two saves using the existing filename.

The code only needs limited change for use in Excel - change ActiveDocument to ActiveWorkbook and .doc to .xls (although I haven't tried it out in Excel).

Sub SaveX2()
Dim strFN As String
Dim strFX As String
Dim strL1 As String
Dim strL2 As String

'setup two locations - ending with /
strL1 = "H:/"
strL2 = "C:/Temp/"

'get filename from user
strFN = InputBox("Enter file name without extension", "Save to Stick and HDD")
'check for no file extension
If InStr(1, strFX, ".") > 0 Then
    strFX = Left(strFX, InStr(1, strFX, "."))
End If
'get existing filename and extract file extension
strFX = ActiveDocument.Name
'test for file extension on current document
If InStr(1, strFX, ".") = 0 Then
    'none so use a default
    strFX = ".doc"
    'use existing
    strFX = Right(strFX, Len(strFX) - InStr(1, strFX, ".") + 1)
End If

'create the filename
strFN = strFN & strFX

'save to stick first
ActiveDocument.SaveAs FileName:=strL1 & strFN
'save to HDD second
ActiveDocument.SaveAs FileName:=strL2 & strFN
End Sub

There is no error checking in this as its just an outline


Report •

February 12, 2010 at 15:05:49
Thank you.

I feel this will work. But being (presently) unfamiliar with Word Macros, I will hold on to the solution you graciously offered, and hope another might come along.

Report •

February 12, 2010 at 15:25:43

If at some time you want to try this approach, send me a private message through this forum, and I will come back to this post and give you a step-by-step on what is required to load and run the macro.


Report •

Related Solutions

February 12, 2010 at 17:37:49
re: ...and hope another might come along

You might be waiting a long time!

As far as I know, there's nothing built into Windows that is going to save a file to 2 different locations with a single action.

I'm guessing that anything other than the macro Humar offered would have to be some sort of VB based script operating at the command line level. It's going to be one unfamiliar language or anther, so you might as well opt for the one where help is readily available.

I've been using a fairly simple DualSave macro in Excel for a few years. In my case, I want to browse to each folder, so the code allows me do that. The "savings" is in the fact that I click one custom icon on my menu bar and the code opens the dialog boxes for both Save As operations.

Option Explicit
Sub DualSave()
' DualSave Macro
' Macro Written 6/25/2005 by DerbyDad03
Dim fileSaveName
'Get Filename, Default = FileName
    fileSaveName = Application.GetSaveAsFilename()
'Save File to Chosen Location
    If fileSaveName <> False Then
        ActiveWorkbook.SaveAs Filename:=fileSaveName
    End If
'Do it again
    fileSaveName = Application.GetSaveAsFilename()
    If fileSaveName <> False Then
        ActiveWorkbook.SaveAs Filename:=fileSaveName
    End If
End Sub

Report •

February 12, 2010 at 18:53:04
To Humar and Derbydad03:

Wonderful advice and opinion. I thank you both. And also for the offer of Macro help if need be at the time.

Report •

Ask Question