Need to test all open forms if modal.

Dim ctrl As Object

For Each ctrl In VBA.UserForms
    If TypeOf ctrl Is MSForms.UserForm Then
        'if ctrl is modal then unload ctrl else ctrl.hide
        End If
Next ctrl