none
Excel process thread hiJacks KeyBoard strokes RRS feed

  • Question

  • Hi Team,

    We have a Developed a VSTO Add-In (Excel Add-In) Application with couple of Buttons in the Ribbon.

    On Starting/launching the Application, It launches excel Instance. On the Button Click We are instantiating the WPF window having some Input Textboxes for the user to Enter the Values.

    The Issue here is When we try to type in the Textboxes, It types it in the Excel window.

    The Wpf window runs under the same process of the Add-In which is (Excel Process).

    could you please suggest a solution foe this issue.

    THANKS

    Amol

    Thursday, December 4, 2014 2:02 PM

All replies

  • Hello Amol,

    What code do you use for displaying your WPF window?

    Did you try to use Windows form controls instead to implement the task?

    Thursday, December 4, 2014 2:19 PM
  • private ShellWindowView _enquiryManagerClient;
            public ShellWindowView EnquiryManagerClient
            {
                get
                {
                    if (_enquiryManagerClient == null)
                    {
                        _enquiryManagerClient = new ShellWindowView(Globals.ThisAddIn.Application, "QuoteViewModel");
                        _enquiryManagerClient.Closing += EnquiryManagerClientOnClosing;
    
                    }
                    return _enquiryManagerClient;
                }
            }
    
    
    
    private void btnEnquiryManager_Click(object sender, RibbonControlEventArgs e)
            {
                ClickedButton = sender as Microsoft.Office.Tools.Ribbon.RibbonButton;
                EnquiryManagerClient.ShowDialog();
                       }

    Hi Eugene,

    Thanks for the reply.

    I have put in the code above.

    btnEnquiryManager --> a button on the Ribbon

    "QuoteViewModel" --> A Wpf View to be opened on Click of Ribbon button

    EnquiryManagerClient --> A property which instantiate the Wpf window object.

    We have been using MVVM with WPF & not the Windows Forms. Please let me know if you need any other information

    Thanks

    Amol

    Thursday, December 4, 2014 3:08 PM
  • I'd suggest running a Windows form instead. Or you can try to place your WPF controls on the Windows form. Does it work as expected?
    Thursday, December 4, 2014 6:38 PM
  • Hi Alngale,

    In addition, if the code in the secnarion suggested by Eguene worked expected, would you mind sharing a code sample to help us to rerpduce this issue.

    Please remove the sensitive information and you can upload it via OneDrive.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 5, 2014 5:43 AM
    Moderator