Results 1 to 6 of 6

Thread: Kill (97 sr2)

  1. #1
    Lounger
    Join Date
    Feb 2001
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Kill (97 sr2)

    MsgBox DROPFOLDERFILEPATH & filename
    Kill DROPFOLDERFILEPATH & filename

    These are two lines of code in my function. When I hit the MSGBox, which I added for testing only, the correct file path shows up
    When I hit the Kill statement I get runtime error 53 file not found. I am going crazy. What am I doing wrong. I have used this before with no problem. The filename in the kill statement contains the correct data but the DropFolderFilePath looks blank.

    HELP!

    THANKS IN ADVANCE

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Kill (97 sr2)

    Have you made sure that the value of DROPFOLDERFILEPATH ends in a backslash?

  3. #3
    Lounger
    Join Date
    Feb 2001
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Kill (97 sr2)

    Yes
    I am so confused because I use a very similar logic in another program. Here is the entire function

    Function archive(DROPFOLDERFILEPATH, ErrorFilePath, filename)
    rst.Close
    Set rst = Nothing
    fnamein.Close
    db2.Close

    MsgBox DROPFOLDERFILEPATH & filename ' testing only
    Kill DROPFOLDERFILEPATH & filename

    End Function


    DROPFOLDERFILEPATH contains the correct value until it gets to the Kill statement

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Kill (97 sr2)

    Sometimes VBA gets confused. Try deleting the entire line with the Kill statement, then type it in again from scratch.

  5. #5
    Lounger
    Join Date
    Feb 2001
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Kill (97 sr2)

    What I found out is that the txt file that was in the directory got corrupted. The help desk had to blow it out of the directory. When they did that everything ran fine.
    Again, thanks for you help. This was just a weird problem that wasted alot of my time today.

    Cathy

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Kill (97 sr2)

    Aaargh! Yes, things like that happen sometimes, unfortunately. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

Posting Permissions

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