Working With Other Workbooks And Files

Exir a

You can use different optional properties with the FileSearch object to search for specific file on a system. The following table lists the most useful properties.




Indicates the name of the file to locate during the file search. This value can be a specific filename or contain the wildcard symbols * and ?.


A MsoFileType constant value indicating the type of files to look for during the file search. See Appendix A for the available MsoFileType constant values.


Returns a FoundFiles object containing the names of the file matches.


A MsoLastModified constant value indicating the amount of time since file was last modified. See Appendix A for the MsoLastModified constant values.


Indicates the folder to search.


Boolean value used with TextOrProperty property to indicate if only files containing specified text should be returned.


Boolean value indicating whether the subfolders of the folder specified by the .LookIn property should also be searched.


A string that sets the word or phrase to search for in the body of the file or the file's properties. The string can include the * and ? wildcard symbols.

Vba Form Many Excel Files Show

, Type Pathlnfo = FoundFiles(i).

■ If Excel finds the specified file it is opened.

, Type Pathlnfo = FoundFiles(i).

—— Type additional VBA code to execute for each file match.

—E Type Workbooks.Open Filename:=PathInfo.

■ If Excel finds the specified file it is opened.

Was this article helpful?

0 0

Post a comment