I'm trying to create a copy of my file to a different directory. I'm using a cmd button on a form to call it. It works fine the first time but the next time it opens both files at once and then gives the message that "you can not save a file with the same name of a file that is open"
Why would my original macro migrate to the saved file?
Sub SaveAsFri()
' Starts the save Monday Plan routine
clean_rows
Application.DisplayAlerts = False
ChDir "E:\Friday_Plan"
ActiveWorkbook.SaveAs FileName:="E:\Friday_Plan\PA2_Fri.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
MsgBox "Your File has Been saved and is ready for uploading", vbInformation, "Save Complete"
ThisWorkbook.Saved = False
Application.Quit
Close ' Closec
End Sub
Why would my original macro migrate to the saved file?
Sub SaveAsFri()
' Starts the save Monday Plan routine
clean_rows
Application.DisplayAlerts = False
ChDir "E:\Friday_Plan"
ActiveWorkbook.SaveAs FileName:="E:\Friday_Plan\PA2_Fri.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
MsgBox "Your File has Been saved and is ready for uploading", vbInformation, "Save Complete"
ThisWorkbook.Saved = False
Application.Quit
Close ' Closec
End Sub
Code: