+ Reply to Thread
Results 1 to 3 of 3

Run-time error '1004':File not found

  1. #1
    Registered User
    Join Date
    12-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    24

    Run-time error '1004':File not found

    Heya everyone,

    I have been having problems with a script and hoped that someone could help.

    The script below scans through a specified folder on a network and scans every xls file inside that folder for a value. When it finds the spreadsheet which contains that value (a policy number) it outputs some of the data from the matching file and also provides a link to the sheet in question.

    It worked perfectly until I saved, exited and re-opened the file and now I am getting a 1004 run-time error every time I try and execute the script.

    I cant for the life of me work out a cause.

    More baffling, the wording of the error says that the file 'R:\Dir\Cancellations.xls' could not be found.

    At no point is a file called 'Cancellations.xls' specified. Why has the script decided to search for a file called 'Cancellations'?

    Baffling,

    Thanks in advance,

    DomV


    Please Login or Register  to view this content.
    And the line that the debugger flags is:

    Please Login or Register  to view this content.
    Last edited by DomV; 12-09-2009 at 10:26 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run-time error '1004':File not found

    X-post here BTW.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    12-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Run-time error '1004':File not found

    Solved by changing

    Code:
    ChDir MyPathto:

    To

    Code:
    ChDrive "R:"
    ChDir MyPath

+ 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