DIAdem Help

Property: Count for Files

  • Updated2024-09-12
  • 1 minute(s) read

Property: Count for Files

Returns the number of files in a folder.

Object.Count
ObjectFiles
Object with this property
Object.CountLongInteger with read access

The following example returns the number of files in a folder:

Function CountFiles(sFolderSpec)
  Dim fso, oMyDrive, oMyFolder, oMyFiles
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyFolder = fso.GetFolder(sFolderSpec)
  Set oMyFiles = oMyFolder.Files
  CountFiles = "Number of Files: " & oMyFiles.Count
End Function

Log in to get a better experience