Results 1 to 2 of 2

Thread: VSTO Excel Workbook got focus event

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    VSTO Excel Workbook got focus event

    In my workbook I can only see the initialize, startup and shutdown events.
    Is it possible to perform an action when the workbook gets the focus?

  2. #2

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: VSTO Excel Workbook got focus event

    I tried this in the sheet code behind and whilst the internal startup code is run the Activate_Event never gets called from startup or on receiving focus.
    Code:
    private void InternalStartup()
            {
                this.ActivateEvent += new Microsoft.Office.Interop.Excel.DocEvents_ActivateEventHandler(this.Activate_Event);
    
            }
    
            private void Activate_Event()
            {
                Globals.ThisWorkbook.Application.SendKeys("%RPT{RETURN}", true);
    
            }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width