Application.ScreenUpdating = False
With ThisWorkbook.Worksheets("RICERCA")
Comm1 = .Range("B3").Value '<<< nome cella 1
Comm2 = .Range("B4").Value '<<< nome cella 2
Comm3 = Comm1 & "-" & Comm2 '<<< unite
End With
Path = Path & Comm3
Call GetSubFolders(Path, FoundFiles, -1)
FoundFiles = Application.Transpose(FoundFiles)
If UBound(FoundFiles, 1) >= 0 Then
For cartella = 1 To UBound(FoundFiles, 1) - 1
On Error Resume Next
Workbooks.Open FoundFiles(cartella, 1) & "\" & FoundFiles(cartella, 2)
If Err.Number = 9 Then
MsgBox "il percorso/path < " & Path & " >" & Chr(13) & _
"non è eatto o il nome è stato cambiato.", vbCritical, "ERRORE PATH"
Exit Sub
End If
On Error GoTo 0
nome_file = ActiveWorkbook.Name
---------------
excel 2007