Dim m_objFSO As Scripting.FileSystemObject '定义文件系统对象
Set m_objFSO = New Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Set objFolder = m_objFSO.GetFolder(mypath) 'mypath="c:\program files\aaa\"
Dim objFile As Scripting.File '文件对象
For i = 1 To objFolder.Files.Count
Debug.Print objFolder.Files.Item(i)
Next[/colo]
'For Each objFile In objFolder.Files
' Debug.Print objFile.ShortName
'Next
上面红色部分的代码不能正常运行,总是出现 实时错误5,无效的过程调用或参数