I have a code that detects if a userform is loaded or not (The code works in the workbook that has the code)
Code: Select all
Sub Test_IsLoaded()
If IsLoaded("UserForm1") Then
MsgBox "UserForm Is Open", 64
End If
End Sub
Function IsLoaded(formName As String) As Boolean
Dim frm As Object
For Each frm In VBA.UserForms
If frm.Name = formName Then
IsLoaded = True
Exit Function
End If
Next frm
IsLoaded = False
End Function