Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net Excel Add-in Form dissapears after opening through Excel double click

Hi

I open a form through the Excel double click in my Excel VB.net add-in, but it keeps
jumping behind Excel. My code follows. What can I do to prevent this?

    Private Sub Application_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Microsoft.Office.Interop.Excel.Range, ByRef Cancel As Boolean) Handles Application.SheetBeforeDoubleClick
        Try
            If Globals.Ribbons.Ribbon1.ToggleButton_OpenElementPanes.Checked = True Then

                Dim Form_DoubleClickMenu As New frmDoubleClickMenu
                Form_DoubleClickMenu.Show()
                Form_DoubleClickMenu.BringToFront()
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

That worked very well. Thanks very much!
Thanks very much