Function FilesTree(sPath) Dim i : i=0 on error resume Next Set oFso = CreateObject( "Scripting.FileSystemObject" ) Set oFolder = oFso.GetFolder(sPath) Set oFiles = oFolder.Files For Each oFile In oFiles If Right(oFile.Path,3)= "xls" Then Msgbox oFile.Path i=i+1 End If Next Msgbox "您的" &sPath& "目录下,一共存在" &i& "个Excle文件" Wscript.Quit End Function |
|
来自: liuchangxin81 > 《待分类1》