LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Capturing Unknown Subfolder Name

Hi All,

I'm trying to find a way to capture a string containing the pathname of a
folder's subfolder.

For example, assume the root directory has two subfolders, named
"mynewstuff" and "myoldstuff", but you (the programmer) don't know these
names ahead of time. What code would produce a string array containing (at
element 0) "c:\mynewstuff\" and (at element 1) "c:\myoldstuff"? My goal is
to create an array containing the pathnames of all the folders on the
computer (and network if present). This s/b fairly easy using a recursive
looping routine, starting with the root directory and drilling down getting
the name of each folder's immediate subfolder(s).

I thought about trying to use ChDir to somehow get to the subfolder and then
using CurDir to get the full path, but I can't use ChDir without a specific
subfolder path, which of course is what I'm seeking.

Application.FileSearch.SearchScopes possibly could help, but I can't
determine whether it would or not.

I know the Subfolders property of File System Objects in Windows Script is
just what I need, but I must avoid using FSO due to security concerns.

I would appreciate any help with VBA or Office (Excel) code that would
generate an unknown subfolder path string.

TIA.

Roy


 
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
Excel links to subfolder Mark Farrell Excel Discussion (Misc queries) 1 May 23rd 08 08:21 PM
Importing from a subfolder in your Inbox into excel Terri Excel Discussion (Misc queries) 1 February 22nd 07 06:58 PM
Copy excel file to subfolder Myrna Rodriguez Excel Programming 0 September 16th 04 09:03 PM
subfolder Loop? But, only one.... foamfollower Excel Programming 1 November 12th 03 01:37 AM
how to step thru only one subfolder of a folder to find like files foamfollower Excel Programming 1 November 11th 03 08:40 PM


All times are GMT +1. The time now is 08:33 AM.

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

About Us

"It's about Microsoft Excel"