I have a workbook project(VSTO 2007). What I want to do is that I want to execute some method by pressing CTRL+R.
What I have done is the below
private void InternalStartup()
{
this.btnProcessTable.Click += new System.EventHandler(this.btnProcessTable_Click);
Globals.ThisWorkbook.Application.OnKey("^r", "test");
}
And the test method is
private void test()
{
MessageBox.Show("Just a test");
}
Next when I ran the application and press CTRL + R , I encounter the below message
Cannot run the macro test. The macro maynot be available in this workbook or all macro's may be disable
I check that all the macros are enable and the funciton (test) is in the same workbook.
Any idea of how to fix the issue.
Thanks