I have this code and its creates a folder and saves a workbook
Not clear as what is wrong with the code. it is giving error as Error 1004
Not clear as what is wrong with the code. it is giving error as Error 1004
VBA Code:
Sub FoldtoBackupA()
Dim Path As String
Dim path1 As String
Dim Folder As String
Dim Answer As VbMsgBoxResult
Dim relativePath As String
Path = Application.ThisWorkbook.Path & "\" & "ISFReportAtt"
Folder = Dir(Path, vbDirectory)
If Folder = vbNullString Then
VBA.FileSystem.MkDir (Path)
'Exit Sub
Else
'MsgBox "Folder exists."
End If
Call SaveFile1
End Sub
Sub SaveFile1()
Dim sFilename As String
'Refersh Pivot Table
Workbooks("Fiserv Intraday Generator Hourly.xlsb").Activate
sFilename = Sheets("Email").Range("c5").Value & ".xlsx"
Workbooks.Add
'Saving the Workbook
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & "ISFReportAtt" & "\" & sFilename [B]' Error 1004[/B]
End sub