VBA

Moderators: PavlinII
Number of threads: 1614
Number of posts: 3000

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Import files into Access from Main directory Posted by bdthomas02 on 28 Jul 2008 at 8:54 AM
Hello everyone,

I am new to VBA but I do have an understanding of the code. Here is what I want to do:

The user clicks the main folder called XML. There are twenty folders in the XML tree (e.g. XML/Code/Programs/Data/Software/Files/etc.) and each folder contains a number of files consisting of txt, jpg, doc, xml, rtf, etc. The user wants all of the XML files from each folder in the tree to import into Access. I am looking for code that will allow the user to click the main XML folder and automatically search, find, and export all XML files from the rest of the folders in the tree to Access. Is there any code available that will do this or does anyone out there know how to do this?

Thanks,

bdthomas02

Report
Re: Import files into Access from Main directory Posted by Barkeeper on 28 Jul 2008 at 10:33 PM
To Select a Folder --> API "SHBrowseForFolder" --> There are ton's of examples on the net.

To search a Folder tree for files with a specific extension you need a recursive search-algorithm. The API's "FindFirstFile", "FindNextFile" and "FindClose" are your friends (i remember having coded something like this some years ago)

: Hello everyone,
:
: I am new to VBA but I do have an understanding of the code. Here is
: what I want to do:
:
: The user clicks the main folder called XML. There are twenty
: folders in the XML tree (e.g.
: XML/Code/Programs/Data/Software/Files/etc.) and each folder contains
: a number of files consisting of txt, jpg, doc, xml, rtf, etc. The
: user wants all of the XML files from each folder in the tree to
: import into Access. I am looking for code that will allow the user
: to click the main XML folder and automatically search, find, and
: export all XML files from the rest of the folders in the tree to
: Access. Is there any code available that will do this or does
: anyone out there know how to do this?
:
: Thanks,
:
: bdthomas02
:
:

------------------------------------------
Only stupidity of mankind and the universe
are infinite, but i'm not sure concerning
the universe. A. Einstein
Report
Re: Import files into Access from Main directory Posted by bdthomas02 on 29 Jul 2008 at 6:02 AM
Do you have the code to lean to me?
: To Select a Folder --> API "SHBrowseForFolder" --> There are ton's
: of examples on the net.
:
: To search a Folder tree for files with a specific extension you need
: a recursive search-algorithm. The API's "FindFirstFile",
: "FindNextFile" and "FindClose" are your friends (i remember having
: coded something like this some years ago)
:
: : Hello everyone,
: :
: : I am new to VBA but I do have an understanding of the code. Here is
: : what I want to do:
: :
: : The user clicks the main folder called XML. There are twenty
: : folders in the XML tree (e.g.
: : XML/Code/Programs/Data/Software/Files/etc.) and each folder contains
: : a number of files consisting of txt, jpg, doc, xml, rtf, etc. The
: : user wants all of the XML files from each folder in the tree to
: : import into Access. I am looking for code that will allow the user
: : to click the main XML folder and automatically search, find, and
: : export all XML files from the rest of the folders in the tree to
: : Access. Is there any code available that will do this or does
: : anyone out there know how to do this?
: :
: : Thanks,
: :
: : bdthomas02
: :
: :
:
: ------------------------------------------
: Only stupidity of mankind and the universe
: are infinite, but i'm not sure concerning
: the universe. A. Einstein

Report
Re: Import files into Access from Main directory Posted by Barkeeper on 29 Jul 2008 at 11:58 PM
: Do you have the code to lean to me?

Yeah, but i'm at work now, have to look it up at home. Tomorrow!
------------------------------------------
Only stupidity of mankind and the universe
are infinite, but i'm not sure concerning
the universe. A. Einstein



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.