+ Reply to Thread
Results 1 to 8 of 8

File Not Found using network paths.

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    File Not Found using network paths.

    I am trying to rename a file using a network path rather than a mapped drive letter due to the fact that different people use different drive letters for the specific location.

    When I use the "name filefrom fileto" approach I am getting a "File not found" error. Again, things work fine when I use a drive letter, but that's no longer practical.

    I can do a test (dir) on the folder where the file is located and I get a positive result, meaning the code "finds" the FOLDER. But, when I do the same test on the FILE itself (using the whole UNC file path) the code cannot find the file.

    Any ideas?

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: File Not Found using network paths.

    can you provide your code?

    i'm guessing that the file path has an error in it it should be in the following format:
    \\MAMMOTH\AcctDocs\filename.extention

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    Re: File Not Found using network paths.

    Absolutely, only posting the code is tricky because the folder and filename makeups are in the form of variables.

    My first thought was that of a typo as well, but I've gone over the strings about a hundred times now.

    The path to the file is this:
    "\\grsbncsxr03\shr_Eastern_Eastern_GRSB_Fso\Eastern FCCMT\CMT Standard Documents\_Contract Award Folders\_Buyer Folders\Test 4\Contract Award Data.xls"

    This is part of the larger macro code:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: File Not Found using network paths.

    Please Login or Register  to view this content.
    You have a leading space in the filename.

    EDIT: NVM, thought that was a directory.
    Last edited by shg; 01-24-2013 at 06:35 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    Re: File Not Found using network paths.

    That's just a space between the buyer name and the "Contract Award..." . It's intentional.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: File Not Found using network paths.

    So print the filename to the debug window and see if it is correct.

  7. #7
    Registered User
    Join Date
    10-25-2012
    Location
    Washington DC
    MS-Off Ver
    For MS 365
    Posts
    54

    Re: File Not Found using network paths.

    Well, it turns out that the file name, path and everything else was fine.

    The firewall between me and this particular server was causing the "name" statement to time out, if I'm saying that correctly anyway. I was able to test the code on the "other side" of the firewalll this morning and it runs fine. No errors.

    Still have to figure out the firewall problem, but at least it's not my code.

    Thanks all.

    Cheers.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: File Not Found using network paths.

    Interesting, glad you got it sorted, and thanks for sharing.

+ Reply to Thread

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