I have the following code which i can loop through all the .dwg files inside a folder.
Private Sub CommandButton1_Click()
'open file to extract
Dim MyFolderext As String
Dim MyFileext As String
'origin
MyFolderext = "C:\Users\abc\test"
MyFileext = Dir(MyFolderext & "\*.dwg")
Do While MyFileext <> ""
Application.Documents.Open MyFolderext & "\" & MyFileext
'check sub if not enough inputs were placed on the user console
check
'unlock drawing layers
ThisDrawing.Layers("MC_BLOCO_INFO_AREAS").Lock = False
ThisDrawing.Layers("MC_BLOCO_TEXTOS_COMERCIAL").Lock = False
ThisDrawing.Layers("MC_BLOCO_TEXTOS_INV").Lock = False
'sub of the program
program
MyFileext = Dir
Loop
'when finished
MsgBox "Done!"
'sub to clean to console for next operation
clean
End Sub
While it works in all the files inside a folder, I cannot make it work with subfolders and I still would need to filter some of them. So what I am asking is: can you help me changing the code to open all the folders inside the mother folder "C:\Users\abc\test" but skip folders "ignore"?