+ Reply to Thread
Results 1 to 2 of 2

Trapping Keystrokes from Addin

  1. #1
    Peter
    Guest

    Trapping Keystrokes from Addin

    Hi,
    I have developed an Excel Addin using VB .NET and am trying to work out
    how to capture keypress events.

    I suspect it would follow the same principles as a COM

    I see the Application.OnKey method, but this only seems to call an
    excel macro. Is there any way for it to trigger an VB event.
    Any ideas would be most appreciated.

    Regards,
    Peter


  2. #2
    Stephen Bullen
    Guest

    Re: Trapping Keystrokes from Addin

    Hi Peter,

    > I have developed an Excel Addin using VB .NET and am trying to work out
    > how to capture keypress events.
    >
    > I suspect it would follow the same principles as a COM
    >
    > I see the Application.OnKey method, but this only seems to call an
    > excel macro. Is there any way for it to trigger an VB event.
    > Any ideas would be most appreciated.


    Unfortunately, the Excel Application doesn't expose keyboard events for
    external automation clients to bind to (be that COM Addins, VB6 or
    VB.NET). The OnKey can only be used to call a VBA routine. This is one of
    the reasons why I recommend incorporating VB.NET into Excel-based
    applications by exposing them as COM Classes, loaded and controlled by a
    VBA wrapper addin.

    Regards

    Stephen Bullen
    Microsoft MVP - Excel
    www.oaltd.co.uk



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1