Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Trying to get My Computer / Search results into a worksheet

I would like to use VBA from within an Excel workbook to run the Search
function of the My Computer dialog, and return the found files to a
worksheet. I am aware of the existence of the FileSearch object, but it
doesn't seem to give me the option to display a dialog box like that in My
Computer/Search to define the directories to be searched and the filters to
be used. The FileDialog object allows the selection of directories, but
seemingly only for one drive at a time (I would like to be able to search all
of My Computer).

Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Trying to get My Computer / Search results into a worksheet


If you want to search all drives then you don't have to select them from a dialog.
Just loop thru all of them and get the files from each one...
'--
Sub InterogateAllDrives()
'Jim Cone - Portland Oregon - June 2008
Dim oFSO As Object
Dim oAllDrives As Object
Dim oDrive As Object

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oAllDrives = oFSO.drives
For Each oDrive In oAllDrives
If oDrive.IsReady Then

'do something with the files on the drive.

End If
Next 'oDrive

Set oDrive = Nothing
Set oAllDrives = Nothing
Set oFSO = Nothing
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins - free trial of "List Files" - no registration)




"Randy in Calgary" <

wrote in message
I would like to use VBA from within an Excel workbook to run the Search
function of the My Computer dialog, and return the found files to a
worksheet. I am aware of the existence of the FileSearch object, but it
doesn't seem to give me the option to display a dialog box like that in My
Computer/Search to define the directories to be searched and the filters to
be used. The FileDialog object allows the selection of directories, but
seemingly only for one drive at a time (I would like to be able to search all
of My Computer).
Thanks for your help.
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
how to highlight the results of a search string in a worksheet? Raju Excel Worksheet Functions 1 October 22nd 09 11:52 AM
File-search results in worksheet hmm Excel Worksheet Functions 8 January 4th 07 07:04 PM
search column and output results in new worksheet in a different o Paul Excel Programming 6 March 19th 06 06:46 PM
I cant do a search on this forum. Everytime I search, it comes up with zero results viswanthank Excel Programming 3 June 10th 05 09:15 AM


All times are GMT +1. The time now is 04:53 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"