Results 1 to 2 of 2

Thread: FileSystemObject error

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    274

    FileSystemObject error

    Private Sub Form_Load()
    Dim fso As FileSystemObject, fileo As File, diro As Folder
    Dim m_folderpath As String
    m_folderpath = "c:\test\xu\"
    Dim m_filename As String

    Set fso = New FileSystemObject
    Set diro = fso.GetFolder(m_folderpath)
    For Each fileo In diro
    m_filename = "": m_filename = fileo.Name
    Next

    End Sub

    Error highlighting "For Each fileo In diro", indicating that "object doesnt support this property or method".

  2. #2
    Lively Member ashokkumard's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    119

    Re: FileSystemObject error

    Hi

    a minor change in for each, try this

    For Each fileo In diro.files
    m_filename = "": m_filename = fileo.Name
    Next
    Thanks
    Ashok

    Nothing is permanent except changes!..

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