Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default quick list of directories..

I'm looking for a quick way to get a list of directories.

I first tried this type of scheme from the Scripting.FileSystemObject 's

Set f = fs.getfolder(stDir)
Set fc = f.SubFolders

but that seems to run really slowly for any directory with a couple of
hundred subfolders.

I also tried the Dir function with the vbDirectory set as the attribute.

That gets the directories, but it gets them along with the files (ahah! I
think that will work for specifically what I'm doing now, now that I think
about it again).

But I'd still like to know a faster way to get only the subfolder names, if
someone knows one.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default quick list of directories..

Afaik Dir is as fast as it gets in Windows. See
http://www.dicks-blog.com/archives/2...attr-function/
for code.

HTH. Best wishes Harald

"mark" skrev i melding
...
I'm looking for a quick way to get a list of directories.

I first tried this type of scheme from the Scripting.FileSystemObject 's

Set f = fs.getfolder(stDir)
Set fc = f.SubFolders

but that seems to run really slowly for any directory with a couple of
hundred subfolders.

I also tried the Dir function with the vbDirectory set as the attribute.

That gets the directories, but it gets them along with the files (ahah!

I
think that will work for specifically what I'm doing now, now that I think
about it again).

But I'd still like to know a faster way to get only the subfolder names,

if
someone knows one.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default quick list of directories..

Thanks, Harald.

I think "If GetAttr(sPath & sDirName) = vbDirectory " will do exactly what I
need, at a good speed. The f.Subfolders property I mentioned first was
unusably slow.

Thanks for your help.
Mark

"Harald Staff" wrote:

Afaik Dir is as fast as it gets in Windows. See
http://www.dicks-blog.com/archives/2...attr-function/
for code.


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
Create list from directories SoloGIS Excel Discussion (Misc queries) 1 November 22nd 05 09:01 AM
File Open doesn't display all directories (List vs Details) OakCity Excel Discussion (Misc queries) 4 September 2nd 05 01:40 AM
Quick Jump to end of list... Brian Excel Worksheet Functions 6 December 15th 04 10:51 PM
Creating a list of directories mousetrap Excel Programming 1 July 24th 04 05:22 AM
Getting list of directories mousetrap Excel Programming 2 May 29th 04 01:51 PM


All times are GMT +1. The time now is 12:17 AM.

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"