Really annoying...

donthate918

New Member
Joined
Sep 19, 2017
Messages
14
So I have this...

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.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
To pick the obvious, what is Filename when the Save fails?

Does the path exist?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top