mikieprojects48
New Member
- Joined
- Jun 5, 2011
- Messages
- 9
I'm working on a macro that will back up my file on a hard drive; I have a macro for that. But now I'm trying to refine it to back up my file in two different locations and I'm having problems with this any help would be appreciated. This is what I have to save to one hard drive.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>Option Explicit
Private Sub WORKBOOK_BEFORECLOSE(CANCEL As Boolean)<o></o>
Dim MSG As String<o></o>
Dim ANS As Integer<o></o>
Dim FNAME As String<o></o>
<o> </o>MSG = "WOULD YOU LIKE TO BACKUP THIS FFIILLEE?"<o></o>
ANS = MsgBox(MSG, vbYesNo)<o></o>
<o> </o>FNAME = "F:\MACROS\" & ThisWorkbook.Name<o></o>
ThisWorkbook.SaveAs FNAME<o></o>
<o> </o>End Sub<o></o>
<o> </o>Option Explicit
Private Sub WORKBOOK_BEFORECLOSE(CANCEL As Boolean)<o></o>
Dim MSG As String<o></o>
Dim ANS As Integer<o></o>
Dim FNAME As String<o></o>
<o> </o>MSG = "WOULD YOU LIKE TO BACKUP THIS FFIILLEE?"<o></o>
ANS = MsgBox(MSG, vbYesNo)<o></o>
<o> </o>FNAME = "F:\MACROS\" & ThisWorkbook.Name<o></o>
ThisWorkbook.SaveAs FNAME<o></o>
<o> </o>End Sub<o></o>