I have this code it creates a folder and code is trying to save the current file in the created folder
but not sure its not working, can there be a fix.
but not sure its not working, can there be a fix.
VBA Code:
Sub FoldtoBackup()
'===================================================
' This will creat a backup folder by name Daily Hajj Final Report
'===================================================
Dim Path As String
Dim path1 As String
Dim Folder As String
Dim Answer As VbMsgBoxResult
Dim relativePath As String
Path = Application.ThisWorkbook.Path & "\" & "Daily Hajj Final Report"
Folder = Dir(Path, vbDirectory)
If Folder = vbNullString Then
VBA.FileSystem.MkDir (Path)
'Exit Sub
Else
'MsgBox "Folder exists."
End If
Sheets(Array("Summary", "Sheet1", "Fiber RawData", _
"Copper RawData", "FTTM 1 RawData", "FTTM 2 RawData", "FTTH RawData", "Fiber Mak Mad Haram")).Select
Sheets("Summary").Activate
Sheets(Array("Summary", "Sheet1", "Fiber RawData", _
"Copper RawData", "FTTM 1 RawData", "FTTM 2 RawData", "FTTH RawData", "Fiber Mak Mad Haram")).Copy
ChDir Path '"D:\"
On Error Resume Next
'Kill "D:\Print Raw Data.xlsx"
ActiveWorkbook.SaveAs Filename:= _
Path & "\" & Sheets("Report").Range("d5").Value.xlsx, FileFormat _
:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close ''' Here is the problem
Sheets("Report").Select
Range("E7").Select
End Sub