Código:
  
Ese pedazo de codigo funciona, el problema es que NO SIEMPRE existe el atributo indicado ahí "webpageelement.GetAttribute("data-endpoint") = /ajax/composerx/attachment/group/post/ "  entonces cuando el atributo no existe el programa arroja una "unhandled exception"  For Each webpageelement As HtmlElement In allelements
                If webpageelement.GetAttribute("data-endpoint") = "/ajax/composerx/attachment/group/post/" Then
                    webpageelement.Focus()
                    webpageelement.InvokeMember("click")
                    Exit For
                End If
            Next
Ese codigo se ejecuta dentro de un bucle, en diferentes paginas en cada iteración.
Lo que necesito es que si el bucle FOR no encuentra algo como webpageelement.GetAttribute("data-endpoint") = "/ajax/composerx/attachment/group/post/" entonces realice un end sub.
gracias por cualquier consejo.
 


