Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Would it be possible for Excel 2000 to compile a report of all files (with an option to include hidden and system files) that reside within a particular directory (and all subfolders within that directory) that reports their Path, File Name, Size, and Date Modified? I can get the "Browse for Folder" dialog box to work (thanks Tom Ogilvy and Bob Phillips), and a textbox on my userform ("txtMainFolder") stores the path entered. All the code for the Userform resides within the Userform Private Modules, but I'd like to write the program in a standard code module by transferring across the txtMainFolder value. However, this is causing a lot of problems as Excel keeps saying that it can't set the object (please see below)...however, if the code below resides in the Userform Module, then it runs fine! For example, I'd like to get a listing of all files within C:\MyFiles (and the txtMainFolder="C:\MyFiles"). My current code is as below: ---------------------------------------------------- ' * The Code in the Userform Private Module: Private Sub OK_Click() ........ Call GetFile(txtMainDir.value) End Sub Sub GetFile(MainDir as String) Dim FSO as Object Dim Folder as Object Dim Files as Object Dim File as Object Set Folder=FSO.GetFolder(MainDir) €˜ <<<< Error Here Set Files=Folder.Files End Sub ------------------------------------------------------- Could you pleas help? Thankyou! SuperJas. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
Trouble with 'save as' or making changes | Excel Discussion (Misc queries) | |||
Opening files in folders and subfolders | Excel Discussion (Misc queries) | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) |