Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have an Addin 2003 Application. In this Application I'm calling an VB 6.0 Dll and I send Excel Application Object as Parameter. In VB Project I'm using Workbook_Open event with WithEvents. I have a messagebox there. Unfortunately when i call VB dll , I get this Error Message -- Type mismatch. Is there any Idea? Code in VS2008 : private Project1.Class1 vbapp; private void ThisAddIn_Startup(object sender, System.EventArgs e) { #region VSTO generated code this.Application = (Excel.Application)Microsoft.Office.Tools.Excel.Ex celLocale1033Proxy.Wrap(typeof(Excel.Application), this.Application); #endregion vbapp = new Class1(); object myAppObject = Globals.ThisAddIn.Application; try { vbapp.AttachApplication(ref myAppObject); } catch (Exception ex) { } Code in VB: Dim WithEvents mExcelApp As Excel.Application Public Sub AttachApplication(xlApp As Object) Set mExcelApp = xlApp End Sub Private Sub mExcelApp_NewWorkbook(ByVal Wb As Excel.Workbook) Call MsgBox("New Workbook opened") End Sub Private Sub mExcelApp_WorkbookOpen(ByVal Wb As Excel.Workbook) Call MsgBox("Excel WorkBook opened" + Wb.Name) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 - Combobox.AddItem type mismatch | Excel Programming | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Excel VBA - Type mismatch during While | Excel Programming |