Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have to following code that is failing to recognize existence of the following file gb200509.txt:

    It recognizes gb200510.txt

    How do I fix this?

    Thank, John


    <pre>10/28/2005 04:58 PM 103 gb200509.txt
    10/28/2005 04:52 PM 35,655 gb200510.txt
    </pre>


    <pre>bRetVal = FileExists(strPathAndFileName)
    If bRetVal = False Then
    MsgBox "File: " & strPathAndFileName & " Does not Exist"
    Call File_Name_Format_Message_GBSB
    Else
    MsgBox "File: " & strPathAndFileName & " Was Found"
    End If
    </pre>



    <pre>Function FileExists(strFileName As String) As Boolean

    On Error Resume Next

    FileExists = (Len(Dir$(strFileName$)) > 0)

    End Function
    </pre>


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

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Are there spaces in the file name in front of gb00509.txt or is that an artefact of your post?

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Hi Hans

    No spaces

    I'm wondering if its the small size of the file?

    John

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

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    No, that has nothing to do with it. Check the contents of strPathAndFileName VERY carefully.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Try commenting out the command:
    On Error Resume Next
    and see if an error pops up.

    Failing that step thru the code and see what the value of strFileName$ is in the following command:
    FileExists = (Len(Dir$(strFileName$)) > 0)

    Or try deleting the $ signs from your code and see if that does anything.

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Hans & Pat

    After further review, you were right, wrong path, been hacking for 12 hours, time to hang it up, off to local pub to hoist a few brewski's

    Thanks, John

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

    Re: Is File Size My Problem? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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