Solved

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

Posted on 2013-01-28
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

739 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