Solved

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

Posted on 2013-01-28
3
214 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

825 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