Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File Search
GOod day all..
How to do file search? I had reading some codes in this forum.. But none suit m application.. I want to search a file(file name is dummy for first time created whether it exists or not, if not exists, it will create the dummy.txt if this file name(dummy.txt) exists, it will automatically assig another name to it, for example, Engine001, and it will search agai and check whether this file name(Engine001) exist or not. If exist, i will create another file name, Engine002 .... until the file name i not exists in the folder, it will use the file name and move on t store data in the file. How to do the search for the above application? Helps from anyone is appreciated~ : -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File Search
Function FileExists(fname As String) As Boolean
With Application.FileSearch .LookIn = "C:\ " .NewSearch .filename = fname .Execute If .FoundFiles.Count = 0 Then FileExists = False Else FileExists = True End If End With End Function Can anyone help me to check whether the function above correct o not..? When I debug the code above, whether the file exists or not, th .FoundFiles.Count is alwaz equal to 0..... Why this happen -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file search or search files | Excel Discussion (Misc queries) | |||
Search a FAQ file | Excel Worksheet Functions | |||
Turning a text file name into a search and linking the file as a hyperlink | Excel Discussion (Misc queries) | |||
File Search | Excel Programming | |||
Macro to search from one file & place on another file. | Excel Programming |