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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
To pick the obvious, what is Filename when the Save fails?

Does the path exist?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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