Hi Kamboj
Thank you for your reply. I inserted the provided code as per below.....The workbook hangs when running the Save Macro.
Any ideas?
Sub Save_File()
Dim Path As String
Dim FName1 As String
Dim FName2 As String
Dim x As Integer
ActiveSheet.Shapes("Shape1").Visible = False
ActiveSheet.Shapes("Shape3").Visible = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Sheets(7).Visible = False
On Error Resume Next
With ActiveWorkbook.VBProject
For x = .VBComponents.Count To 1 Step -1
If .VBComponents(x).Name = "Module2" Then
.VBComponents.Remove .VBComponents(x)
End If
Next x
End With
Path = "C:\Users\Steven\Desktop\Levant\Client backup\" & Stage1document.Range("C12")
FName1 = Range("C12")
FName2 = Range("C14")
MkDir Path
ActiveWorkbook.SaveAs Filename:=Path & "\" & FName1 & "-" & FName2 & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled, WriteResPassword:="01012016"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
If Application.Workbooks.Count = 1 Then
Application.Quit
Else
ActiveWorkbook.Close
End If
End Sub
Bookmarks