J
JFO
Hi,
I'm getting:
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
I believe I do something wrng with the 2. parameter of onkey
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
namespace ExcelAddIn1
{
public partial class ThisAddIn
{
delegate void testDelegate();
testDelegate t1;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
t1 = this.test;
this.Application.OnKey("^G", t1);
//Excel.Range r = this.Application.ActiveCell.DirectDependents;
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
public void test()
{
this.Application.ActiveCell.Value2 = "5";
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
I'm getting:
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
I believe I do something wrng with the 2. parameter of onkey
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
namespace ExcelAddIn1
{
public partial class ThisAddIn
{
delegate void testDelegate();
testDelegate t1;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
t1 = this.test;
this.Application.OnKey("^G", t1);
//Excel.Range r = this.Application.ActiveCell.DirectDependents;
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
public void test()
{
this.Application.ActiveCell.Value2 = "5";
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}