View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] steve.kite@arup.com is offline
external usenet poster
 
Posts: 1
Default Number of files in a folder including sub-folders

In the Windows Folder Properties dialog box, the size of a folder is
displayed, and the number of Files and Folders contained within the
folder are displayed.

In VBA, through Scripting.FileSystemObject it is possible to access
the size of the folder (including sub-folders) but the only way to
access the number of foldes and files appears to be to loop though
each sub-folder and count the files using a recursive function. This
is a slow process when dealing with a lot of sub-folders, eg a whole
drive. Surely it must be possible to access the "Contains" data from
the Folder Properties dialog box and return the total number of Files
and Folders directly.

Does anyone know how to do this?