I'm having some trouble saving spreadsheets on a network drive. I've looked all over Google (on the sites my work laptop will allow me to access), and searched through Mr. Excel, but haven't found anything. I'm using a macro enabled document to open a .xlsx document, complete some fields, then I want to save the .xlsx document on a network drive, using the value of cell K7 as the file name.
When I run the code, I'm getting a Run-time error '1004': Method 'SaveAs' of object'_Workbook' failed error.
I'm not sure if the value in cell K7 having preceding zeroes could be the issue. Both fPath and fName are declared as string
VBA Code:
fPath = [URL='https://www.mrexcel.com/board/file://%5C%5CServer%5CFolder%5C']\\Server\Folder\[/URL]
fName = sMS1.Range("K7").Value & ".xlsx"
s.SaveAs fPath & fName
When I run the code, I'm getting a Run-time error '1004': Method 'SaveAs' of object'_Workbook' failed error.
I'm not sure if the value in cell K7 having preceding zeroes could be the issue. Both fPath and fName are declared as string