Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try to add file extention too Abdul Salam -----Original Message----- Hi I am using the following code to open an excel file, but it is opening not the esact file Run.xls but another one ppp-Run.xls. What Change should I do? Thanks With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .FileName = "Run" .MatchTextExactly = True .FileType = msoFileTypeExcelWorkbooks End With . |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I already done it but the result is the same
"Abdul Salam" wrote in message ... Hi, Try to add file extention too Abdul Salam -----Original Message----- Hi I am using the following code to open an excel file, but it is opening not the esact file Run.xls but another one ppp-Run.xls. What Change should I do? Thanks With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .FileName = "Run" .MatchTextExactly = True .FileType = msoFileTypeExcelWorkbooks End With . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Application.FileSearch
.NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .FileName = "Run" ' .MatchTextExactly = True .FileType = msoFileTypeExcelWorkbooks If .Execute() 0 Then For i = 1 To .FoundFiles.Count if lcase(Right(.FoundFiles(i),7))="\run.xls" then workbooks.open .foundfiles(i) exit for Next i Else MsgBox "file not found." End If End With MatchTextExactly only pertains to searching for a word in a document - does not pertain to the file name. Regards, Tom Ogilvy "Pedro" wrote in message ... I already done it but the result is the same "Abdul Salam" wrote in message ... Hi, Try to add file extention too Abdul Salam -----Original Message----- Hi I am using the following code to open an excel file, but it is opening not the esact file Run.xls but another one ppp-Run.xls. What Change should I do? Thanks With Application.FileSearch .NewSearch .LookIn = "C:\My Documents" .SearchSubFolders = True .FileName = "Run" .MatchTextExactly = True .FileType = msoFileTypeExcelWorkbooks End With . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
file search or search files | Excel Discussion (Misc queries) | |||
VBA code for search button | Excel Worksheet Functions | |||
Is there a code that anables you tto search for a worksheet | Excel Discussion (Misc queries) | |||
VBA-code for search,copy and paste | Excel Discussion (Misc queries) | |||
Post Code search | New Users to Excel |