I use this to back up the staff scheduling program to a file named after the date they did the attendance sheet for.
If MsgBox("Back-Up this Roster", vbYesNo) = vbYes Then
dy = Worksheets("ReSet").Range("RosterDate")
dy = Format(dy, "mm-dd-yy")
dy = (ActiveWorkbook.Path & "Back-Ups Roster for " & dy & ".XLS")
The magic part here is the SaveCopyAs. It saves a copy and will NOT askyou if is is OK to overwrite any existing file with the same name.
Use the F1 key to see what the various parts of the routine are doing.
Yours in EXCELent Frustration
So much time, so little money. This message was edited by KniteMare on 2002-09-10 12:59
However, it looses the file association (.xls) which may be good or bad, depending on your point of view... you can still open it either from within an open XL session, or "openwith" when double-clicking the file icon.