-2

I'm using office developer tools and made a ribbon to access some functions. Thing is, it looks like I can't open a userform from a button, other commands seems to run normally. Code:

Public Class Empresa
    Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles btn_DBSol.Click
        'Dim wnd As New frm_DBSolventes
        'wnd.Show()
        MsgBox("Hello World")
    End Sub
End Class

This code have this result on excel ribbon:

https://s24.postimg.org/6z16l6g43/Print_1.jpg

Now using this code:

Public Class Empresa
    Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles btn_DBSol.Click
        Dim wnd As New frm_DBSolventes
        wnd.Show()
        'MsgBox("Hello World")
    End Sub
End Class

Results in nothing:

There are no errors on Error List window. frm_DBSolventes is a userform on a userform referenced project, there is nothing on the form right now, just made a new project of userform and trying to show it. Is there something I'm missing? Is there any other way where I can use a userform on ribbon?

As Requested the frm_DBSolventes is

https://s29.postimg.org/6w6ae15qd/Print_3.jpg

Just add a datagridview cause I need to continue working. if it makes difference I can change it. There is no code on the form:

Public Class frm_DBSolventes

End Class
  • Is it not trying to open a form in a vb.net itself, rather than Excel? Can you show us what `frm_DBSolventes` is? – David Dec 16 '16 at 14:08
  • Just edited and add a print of the VS and the code from the Form. – Johni Michels Dec 16 '16 at 14:43
  • @David Is there any other thing that i can add to help you answer my problem? – Johni Michels Dec 16 '16 at 15:57
  • Have you tried stepping through the subroutine to display the window? – David Dec 16 '16 at 16:33
  • Yeah. The only way I found was creating a userform in the same project. Creating a Userform from another referenced project won't work. For now this will be ok, I tried call from a sub, but it didn't work either. – Johni Michels Dec 16 '16 at 18:29

1 Answers1

0

Try to show it as a modal Window.

Henrique
  • 66
  • 2