Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying create a macro to open a workbook on a known network drive.
The subfolders that hold the workbook are based on the 5 pieces of information in the workbook when it was initially saved. I want to be able to find the file based on just one unique part (workorder) of the filename. I tried the FileSearch example to see what would happen but seem to keep getting an empty list back (the .execute 0 returns false). Here's the code I used: Set fs = Application.filesearch With fs .LookIn = "\\d1fs02\enginsp$\TEMP\" .filename = workorder .MatchTextExactly = False .FileType = msoFileTypeExcelWorkbooks If .Execute 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count MsgBox .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With Where workorder is based on the value from a textbox on a form. I'm running Excel 2K on Win 2K. Any suggestions or help? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening and deleting File with only partial Filename | Excel Programming | |||
Opening and deleting File with only partial Filename | Excel Programming | |||
Partial Searching on a row | Excel Programming | |||
How do I insert a partial filename? | Excel Discussion (Misc queries) | |||
Searching for partial data in a column | Excel Discussion (Misc queries) |