donthate918
New Member
- Joined
- Sep 19, 2017
- Messages
- 14
So I have this...
in several other spreadsheets (with different paths and cells, all saved to the respective workbook it resides in) but I keep getting a "Run-time error '1004': Method 'SaveAs' of object _Workbook' failed" on this one workbook, and its annoying the hell out of me. Any help or ideas would be greatly appreciated.
Code:
Sub SaveMyWorkbook()
Dim strPath As String
Dim strFolderPath As String
strFolderPath = "S:\Quality Control\Reports\Defects\2017\"
strPath = strFolderPath & _
Sheet2.Range("A1").Value & _
Sheet2.Range("A2").Value & _
Sheet1.Range("C2").Value & _
Sheet2.Range("A2").Value & _
Sheet1.Range("G2").Value & ".xlsx"
ActiveWorkbook.SaveAs Filename:=strPath
End Sub
in several other spreadsheets (with different paths and cells, all saved to the respective workbook it resides in) but I keep getting a "Run-time error '1004': Method 'SaveAs' of object _Workbook' failed" on this one workbook, and its annoying the hell out of me. Any help or ideas would be greatly appreciated.