How to perform .Onkey Event in an Excel Add-In created with Visual Studio 2010?

“I would like to run some code when users presses a combination of keys.” Its tricky and to do it without any external dependencies resort to Keyboard hooking to achieve it with a VSTO Excel Add-in: Imports System Imports System.Runtime.CompilerServices Imports System.Runtime.InteropServices Imports System.Windows.Forms Friend Class KeyboardHooking ‘ Methods <DllImport(“user32.dll”, CharSet:=CharSet.Auto, SetLastError:=True)> _ Private Shared … Read more

How do I create a real-time Excel automation add-in in C# using RtdServer?

(As an alternative to the approach described below you should consider using Excel-DNA. Excel-DNA allows you to build a registration-free RTD server. COM registration requires administrative privileges which may lead to installation headaches. That being said, the code below works fine.) To create a real-time Excel automation add-in in C# using RtdServer: 1) Create a … Read more