Results 1 to 5 of 5

Thread: File Error - Help [Resolved]

  1. #1

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627

    Exclamation File Error - Help [Resolved]

    I have the following code -

    VB Code:
    1. 'format time
    2.     Today = Format(Now, "mm/dd/yyyy")
    3.  
    4.     'format output file name
    5.     outFile = "graybar-po-" & Today & ".dat"
    6.     badPO = "graybar-BADpo-" & Today & ".txt"
    7.    
    8.     'open newly created graybar csv file and take it from there
    9.     Open "c:\winnt\profiles\desktop\graybarTemp.csv" For Input As #1
    10.     Open "c:\winnt\profiles\desktop\" & outFile For Output As #4   '<----------This is the error line
    11.     Open "c:\winnt\profiles\desktop\" & badPO For Output As #5

    I get the "Path Not Found" error on both the Open for Output lines. I have virtually the same code in many app's. What am I missing?!?!?!? I don't see my error.

    Thanks in advance -
    Last edited by demotivater; Aug 22nd, 2002 at 10:44 AM.

  2. #2
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174
    Filenames can't have /'s in them...
    Computer /nm./: a device designed to speed and automate errors

  3. #3

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    ARGH!!!

    Yea, I have the same code in many apps except I don't format the time with "/" in those!!!

    *kicks self*

    Thanks for the extra eyes!

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350
    He seems right about that, it works if you change the file name to somethng simpler, but you left out the username in the path between 'profiles' and 'desktop', or at least on my nt box that's the path
    .

  5. #5

    Thread Starter
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    He was right. It was because I formatted the time as ##/##/###. Can't have the /'s. Switched it to -'s and it works fine. Dumb mistake, but aren't they all??

    Thanks guys

Posting Permissions

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



Click Here to Expand Forum to Full Width