Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to highlight the results of a search string in a worksheet? | Excel Worksheet Functions | |||
File-search results in worksheet | Excel Worksheet Functions | |||
search column and output results in new worksheet in a different o | Excel Programming | |||
I cant do a search on this forum. Everytime I search, it comes up with zero results | Excel Programming |