The following VBA is to name and save multiple files to a mapped network drive on a server. I have the code working when saving locally, however when saving to the mapped network drive, my files keep saving to a default directory rather than the specified location. I have read/write permissions for the network drive.
Thanks in advance...
With ThisWorkbook
Dim newFile1 As String, fName1 As String, newFile2 As String, fName2 As String, newFile3 As String, fName3 As String, newFile4 As String, fName4 As String, newFile5 As String, fName5 As String, newFile6 As String, fName6 As String
fName1 = Range("=LISTS!A1").Value
fName2 = Range("=LISTS!A2").Value
fName3 = Range("=LISTS!A3").Value
fName4 = Range("=LISTS!A4").Value
fName5 = Range("=LISTS!A5").Value
fName6 = Range("=LISTS!A6").Value
newFile1 = fName1
newFile2 = fName2
newFile3 = fName3
newFile4 = fName4
newFile5 = fName5
newFile6 = fName6
' Change directory to suit your PC, including USER NAME
ChDir _
"Z:\Individual_Files"
ActiveWorkbook.SaveAs Filename:=newFile1, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=newFile2, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=newFile3, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=newFile4, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=newFile5, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=newFile6, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.DisplayAlerts = False
End With
Bookmarks