Ti ringrazio per il suggerimento.
Seguendo il link che mi hai indicato ho trovato questa routine che chiude tutte le cartelle aperte
Option Explicit
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SC_CLOSE = &HF060&
Private Const WM_SYSCOMMAND = &H112
Private Const EXPLORER_CLASSNAME As String = "CabinetWClass"
Sub CARTELLETutteChiudi()
Dim iExplhwnd As Long
iExplhwnd = FindWindow(EXPLORER_CLASSNAME, vbNullString)
Do Until Not CBool(iExplhwnd)
SendMessage iExplhwnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&
iExplhwnd = FindWindow(EXPLORER_CLASSNAME, vbNullString)
Loop
End Sub
Ma se invece volessi chiudere soltanto una cartella specifica?
Immagino che dovrei inserire una riga all'interno del ciclo Do Until Not CBool