Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting number of files within a sub-folder and its size Jim Cone Excel Programming 1 July 11th 06 02:02 PM
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? Subteam Excel Discussion (Misc queries) 2 May 7th 06 08:14 PM
Number of files in a folder [email protected] Excel Programming 15 January 19th 06 10:02 AM
delete all the contents (sub folders and files) in the temp folder Joseph Excel Discussion (Misc queries) 0 June 6th 05 08:01 AM
Counting the Number of Folders Not Files. Ron[_8_] Excel Programming 1 August 29th 03 07:35 PM


All times are GMT +1. The time now is 01:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"