I have written this code to access Excel files inside a folder:
strPath="C:Test"
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFso.GetFolder (strPath)
Set objExcel= CreateObject("Excel.Application")
objExcel.Visible= False
For Each objFile In objFolder.Files
If objFso.GetExtensionName(objFile.Path) = "xls" Then
Now I have to create some subfolders and put some .xls files in those.
What modification should I do in my code for searching files in main folder and all other subfolders (there are also some folders inside subfolders)?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…