Solved

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

Posted on 2013-01-28
3
213 Views
Last Modified: 2013-02-04
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
0
Comment
Question by:murbro
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38827186
Can you not use ShowDialog?
0
 

Author Comment

by:murbro
ID: 38850814
That worked very well. Thanks very much!
0
 

Author Closing Comment

by:murbro
ID: 38850824
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now