Results 1 to 4 of 4

Save files to a Mapped Network Drive on server

Threaded View

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    35

    Save files to a Mapped Network Drive on server

    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
    Last edited by wotsup; 03-13-2012 at 09:06 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1