+ Reply to Thread
Results 1 to 8 of 8

File not found in FileDateTime Function

  1. #1
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    File not found in FileDateTime Function

    I have an error mentioned in the title. To me it looks ok especially when I debug.print it seems ok and opens that file as well.



    Please Login or Register  to view this content.
    [/CODE]

  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: File not found in FileDateTime Function

    Perhaps because you are including the '*' character (which is not permitted in a file name) in the sDir variable ?
    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
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: File not found in FileDateTime Function

    Quote Originally Posted by Richard Buttrey View Post
    Perhaps because you are including the '*' character (which is not permitted in a file name) in the sDir variable ?
    Hi
    Seems that you are right. Have any ideas how to overcome this issue? P.S. I need to use "**" for the name variation

  4. #4
    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: File not found in FileDateTime Function

    Hi,

    Since you imply the file name variable bit changes then you must use a variable and allocate the string of varying characters to the variable before you encounter the line of code. And since you seem to have both a preceding and succeeding variable string you first need to Dim two variables for the changing bit of the file name. e.g.

    Please Login or Register  to view this content.
    Then allocate the actual file name. e.g. supposing the characters for the file name variations are in cells A1 and A2 on Sheet1 then

    Please Login or Register  to view this content.
    Then your line of code will be

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: File not found in FileDateTime Function

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Since you imply the file name variable bit changes then you must use a variable and allocate the string of varying characters to the variable before you encounter the line of code. And since you seem to have both a preceding and succeeding variable string you first need to Dim two variables for the changing bit of the file name. e.g.

    Please Login or Register  to view this content.
    Then allocate the actual file name. e.g. supposing the characters for the file name variations are in cells A1 and A2 on Sheet1 then

    Please Login or Register  to view this content.
    Then your line of code will be

    Please Login or Register  to view this content.

    It did not work
    Still says file not found.
    I have declared string variable and singed value "*" to it and then used in the filename as suggested.


    Please Login or Register  to view this content.
    CODE]

  6. #6
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: File not found in FileDateTime Function

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Since you imply the file name variable bit changes then you must use a variable and allocate the string of varying characters to the variable before you encounter the line of code. And since you seem to have both a preceding and succeeding variable string you first need to Dim two variables for the changing bit of the file name. e.g.

    Please Login or Register  to view this content.
    Then allocate the actual file name. e.g. supposing the characters for the file name variations are in cells A1 and A2 on Sheet1 then

    Please Login or Register  to view this content.
    Then your line of code will be

    Please Login or Register  to view this content.
    I have solved it.
    Thanks for help.
    The problem was that in the function FileDateTime(sDir) , the sDir was just the name of file and it should be entire path+filename

  7. #7
    Registered User
    Join Date
    01-08-2022
    Location
    kurdistan
    MS-Off Ver
    2019
    Posts
    1

    Re: File not found in FileDateTime Function

    pls how u do that im so lost
    HTML Code: 
    pls help

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: File not found in FileDateTime Function

    Quote Originally Posted by akahass View Post
    pls how u do that im so lost [HTML]Sub CheckAndUpdateWO()...
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. FileDateTime for a file at an ftp location
    By Nwanda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2014, 02:40 AM
  2. [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
  3. [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
  4. FileDateTime function - how to make it authomatic?
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2006, 09:55 AM
  5. Put only date (not time too) in variable from FileDateTime function
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2006, 02:10 AM
  6. File or function not found error
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2005, 02:05 PM
  7. FileDateTime for Internet web page
    By Mogwai in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2005, 05:05 PM

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