Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP: Function to recursively get all dir/files off a directory???

0 views
Skip to first unread message

A...@a.com

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
I need a VBA function (going to write in Excel or Access) to recursively get
all the subdirectories and files off a particular directory. Can you help?

Pls copy me on the posting at rober...@mindspring.com

Thanks in advance!


A...@a.com

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to

Gary Brown

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
Start with an InputBox to grab the drive, then using the Dir() function,
start with the vbDirectory attribute and write a couple of do...loop-s to
pull the file names and put them in a table, array, etc...

HTH,
Gary Brown


A...@A.COM wrote in article <OBENTMti$GA.1944@cppssbbsa06>...

Joe "Nuke Me Xemu" Foster

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
<A...@A.COM> wrote in message news:8abnj2$1rq$1...@slb7.atl.mindspring.net...

> I need a VBA function (going to write in Excel or Access) to recursively get
> all the subdirectories and files off a particular directory. Can you help?

I have one at <http://members.ricochet.net/~jfoster/>.

--
Joe Foster <mailto:jfo...@ricochet.net> Space Cooties! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!

Tony Toews

unread,
Mar 12, 2000, 3:00:00 AM3/12/00
to
<A...@A.COM> wrote:

>I need a VBA function (going to write in Excel or Access) to recursively get
>all the subdirectories and files off a particular directory. Can you help?

The VBA Developer Handbook, www.developerhandbook, has lots of such routines. I
would suggest getting the set of both books as they are by far the most recommended
book in the newsgroups.

Tony

----
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
VolStar http://www.volstar.com Manage hundreds or
thousands of volunteers for special events.

Sue Hoegemeier

unread,
Mar 13, 2000, 3:00:00 AM3/13/00
to
One approach would be to use the FileSystemObject. There are
several Knowledge Base articles that can get you going. A couple
of them are:
HOWTO: Recursively Search Directories Using FileSystemObject
available at:
http://support.microsoft.com/support/kb/articles/Q185/6/01.ASP
and
HOWTO: Search Directories to Find or List Files
available at:
http://support.microsoft.com/support/kb/articles/Q185/4/76.ASP

--Sue

On Fri, 10 Mar 2000 15:56:50 -0500, <A...@A.COM> wrote:

>I need a VBA function (going to write in Excel or Access) to recursively get
>all the subdirectories and files off a particular directory. Can you help?
>

0 new messages