Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Number of files in a folder including sub-folders
See if this will work for you, from Ken Puls
http://www.vbaexpress.com/kb/getarticle.php?kb_id=238 -- -John Please rate when your question is answered to help us and others know what is helpful. " wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Getting number of files within a sub-folder and its size | Excel Programming | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
Number of files in a folder | Excel Programming | |||
delete all the contents (sub folders and files) in the temp folder | Excel Discussion (Misc queries) | |||
Counting the Number of Folders Not Files. | Excel Programming |