Results 1 to 4 of 4

Thread: Am I Just Retarded Today?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Am I Just Retarded Today?

    How come this is not working?

    Code:
    Dim FSO as FileSystemObject
    Dim objFile as file
    Dim objFolder as folder
    
    'FolderPath = a valid folder name on drive
    Set objFolder = FSO.GetFolder(FolderPath)
    
    For Each objFile In objFolder
     'CODE HERE
    next
    I get an error on the For Each line saying
    object doesn't support property or method

    i could have sworn that this was working a day ago though

  2. #2
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Try this:

    Code:
    Dim fso As New FileSystemObject
    Dim AFile As File
    Dim AFiles As Files
    Dim AFolder As Folder
    
    Set AFolder = fso.GetFolder(folder)
    For Each AFile In AFolder.Files
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  3. #3
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    check out your object browser. It should tell you what you can do.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by cajsoft
    Try this:

    Code:
    Dim fso As New FileSystemObject
    Dim AFile As File
    Dim AFiles As Files
    Dim AFolder As Folder
    
    Set AFolder = fso.GetFolder(folder)
    For Each AFile In AFolder.Files
    YOU DUMB BA$TARD <--- to myself...

    ahhh yes i needed objFolder.Files to loop...

    well thanks for brining me back to average IQ level

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