fsoC
parece não ser declarado / instanciado no seu script. Talvez você gostaria de usar objFSO
novamente?
Editar:
Sub test()
Dim fils As Object
Dim fil As Object
Dim FromPath As String
Dim ToPath As String
Dim objFSO As Object
Dim objFolder As Object
Dim objSubFolder As Object
With Application.FileDialog(msoFileDialogFolderPicker) 'Choosing FromPath
.Show
FromPath = .SelectedItems(1) & "\"
End With
With Application.FileDialog(msoFileDialogFolderPicker) 'Choosing ToPath
.Show
ToPath = .SelectedItems(1) & "\"
End With
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(FromPath)
For Each objSubFolder In objFolder.SubFolders
Set fils = objFSO.GetFolder(objSubFolder & "\").Files
For Each fil In fils
If LCase(Right(fil.Name, 3)) = "zip" Then
MsgBox "this is a zip file "
Else
MsgBox "NOPE"
End If
Next
Next
End Sub
Este código funciona com a seguinte pasta:
A
-- A.1
---- test.txt
---- test.zip