Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
light light is offline
external usenet poster
 
Posts: 1
Default VSTO Excel 2003 to VB 6.0 Type mismatch

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

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VSTO Add-in: Hiding and Showing Word Ribbon Control from VBA snj Microsoft Word Help 1 December 11th 08 05:52 PM
document name mismatch for .DAT files eadgman Microsoft Word Help 1 March 9th 08 08:07 AM
Paper Mismatch CCCMOM Microsoft Word Help 0 January 24th 07 08:47 PM
How do I type in Maths formulas in Word and Excel? William Microsoft Word Help 2 May 20th 06 03:29 PM
Convert to PDF file - page numbers mismatch Mari Microsoft Word Help 5 February 24th 06 09:54 PM


All times are GMT +1. The time now is 10:05 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"