Is there a way to do this?
The user opens an excel workbook.
in cell E17 on a sheet that is named "Work" is the name of the file w/o the extension.
Example, file name is 123456Q1.xls in cell E17 is 123456
The user wants to find all files with 123456 in the file name in the Quote directory or one of its sub directories
He will run a macro called search
The macro will read cell E17, it will open the file search companion and put the contents on cell E17 into the search criteria box.
the user will then click the search button his self.
I found how to run the search box from VBA but cannot figure out how to populate the search field with the cell contents
This is the code I have so far
Thank You
The user opens an excel workbook.
in cell E17 on a sheet that is named "Work" is the name of the file w/o the extension.
Example, file name is 123456Q1.xls in cell E17 is 123456
The user wants to find all files with 123456 in the file name in the Quote directory or one of its sub directories
He will run a macro called search
The macro will read cell E17, it will open the file search companion and put the contents on cell E17 into the search criteria box.
the user will then click the search button his self.
I found how to run the search box from VBA but cannot figure out how to populate the search field with the cell contents
This is the code I have so far
Code:
Option Explicit
'API declaration for the windows "Search Results" dialog
Private Declare Function ShellSearch& Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long)
Private Const SW_SHOWNORMAL = 1
Sub ShowWindowsSearchDialog_API()
' Specified drive to Search
Const szSDrive As String = "[URL="file://server1/shared/QUOTES/"]\\Server1\shared\QUOTES\[/URL]"
ShellSearch 0, "find", szSDrive, "", "", SW_SHOWNORMAL
End Sub
<!-- richText -->
Thank You