I'm using the following to save a copy of my original file in a different directory. The problem is that when I do the SaveAs it is copying the modules to the new file and attempting to run them.
So I get an error saying "Youcan't save a file with the same name of a file that is already open"
Is there a way to strip out or deactivate the modules so they are not copied or activated?
HSub SaveAsFri()
Dim FileName As String
' Starts the save Friday Plan routine
clean_rows
Application.DisplayAlerts = False
M\SaveAs\PA2_Fri.xls",
ChDir "\\mcfl1d324\Pending\Friday_Plan"
ActiveWorkbook.SaveAs FileName:="\\mcfl1d324\Pending\Friday_Plan\PA2_Fri.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Columns("L:L").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.BreakLink Name:= _
"\\mcfl1d324\Pending\Friday_Plan\PA2_Fri.xls", Type:=xlExcelLinks
ActiveWorkbook.Save
MsgBox "Your File has Been saved and is ready for uploading", vbInformation, "Save Complete"
Application.Quit
Close ' Close
End Sub
So I get an error saying "Youcan't save a file with the same name of a file that is already open"
Is there a way to strip out or deactivate the modules so they are not copied or activated?
HSub SaveAsFri()
Dim FileName As String
' Starts the save Friday Plan routine
clean_rows
Application.DisplayAlerts = False
M\SaveAs\PA2_Fri.xls",
ChDir "\\mcfl1d324\Pending\Friday_Plan"
ActiveWorkbook.SaveAs FileName:="\\mcfl1d324\Pending\Friday_Plan\PA2_Fri.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Columns("L:L").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.BreakLink Name:= _
"\\mcfl1d324\Pending\Friday_Plan\PA2_Fri.xls", Type:=xlExcelLinks
ActiveWorkbook.Save
MsgBox "Your File has Been saved and is ready for uploading", vbInformation, "Save Complete"
Application.Quit
Close ' Close
End Sub
Code: