How can I count the number of files which have no file extension (the file dosen't have .something on the end of the file name) in a particular directory?
Thanks Jonathon. Computer problems? Have you checked the loose nut in front of the keyboard yet?
Sub main()
Dim oFSO ' As Scripting.FileSystemObject
Dim oFolder ' As Scripting.Folder
Dim oFile ' As Scripting.File
Dim nCount As Long
Set oFSO = CreateObject("Scripting.FileSystemObject"
Set oFolder = oFSO.GetFolder("C:\"
For Each oFile In oFolder.Files
If oFSO.GetExtensionName(oFile.Name) = "" Then
nCount = nCount + 1
Debug.Print oFile.Name
End If
Next oFile
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.