我已经编写了以下代码来访问文件夹中的Excel文件:
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
现在我需要创建一些子文件夹,并将一些 .xls 文件放入其中。
我应该如何修改我的代码,以便在主文件夹和所有其他子文件夹中搜索文件(还有一些子文件夹中的文件夹)?