【发布时间】:2013-02-03 17:17:10
【问题描述】:
我已经编写了这段代码来访问文件夹中的 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 文件放入其中。
我应该在我的代码中进行哪些修改以在主文件夹和所有其他子文件夹中搜索文件(子文件夹中也有一些文件夹)?
【问题讨论】: