+ Reply to Thread
Results 1 to 4 of 4

Trouble with Name Function: File Not Found

  1. #1
    Registered User
    Join Date
    09-22-2011
    Location
    san diego
    MS-Off Ver
    Excel 2013
    Posts
    76

    Trouble with Name Function: File Not Found

    Hello,

    I'm having trouble figuring out why this is happening and was wondering if anyone has any insights?

    Problem: a full path string works fine for a workbooks.open command but not for name.

    structure of openfile = "C:\several folders\filename1.xlsx"
    structure of newname = "C:\same several folders\filename2.xlsx"

    no forbidden characters are in either path

    The below opens up just fine:

    Please Login or Register  to view this content.
    With the .xlsx file closed, the below returns "file not found"

    Please Login or Register  to view this content.
    So to summarize my question...how can the first code block above work, but the second returns "file not found?" Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trouble with Name Function: File Not Found

    We generally prefer to see the problem in context. Please upload the file.

    Are you saying that 'openfile' is a VBA string Variable with a value "C:\several folders\filename1.xlsx"

    We don't know what 'Name' or 'newname' are.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-22-2011
    Location
    san diego
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: Trouble with Name Function: File Not Found

    Unfortunately (for sorting out this issue) the file contains too much proprietary information to share and I have over 1 month of development time into it. I can try to recreate the scenario in a file that is shareable.

    "name" is me using the name statement

    https://docs.microsoft.com/en-us/off...name-statement

    Does the below help?:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-22-2011
    Location
    san diego
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: Trouble with Name Function: File Not Found

    I think I'm narrowing down on my issue. I assumed that the name function could globally change the full path in one shot.

    It looks like I need to go from right to left on the name changes: first change the .xlsx, then the next level directory and so on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] File not found in FileDateTime Function
    By nosense in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-09-2022, 05:19 PM
  2. [SOLVED] Code update - the latest found file or specific file
    By vendam in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2020, 09:51 AM
  3. If File Not Found In Either Directory Then Message "File Not Found"
    By rjj920 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2016, 06:59 PM
  4. [SOLVED] Shell function gives File not Found error
    By jewelsharma in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2014, 09:38 PM
  5. Excel 2010 file with VBA save and send code works-but file can't be found.
    By carlton.clay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2013, 09:46 AM
  6. [SOLVED] Message (in one window) for each file found/not found
    By kboy1289 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-08-2013, 04:03 PM
  7. File or function not found error
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2005, 02:05 PM

Tags for this Thread

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