VSTO SE Excel problem

D

DrRocket

Something is wrong with the way Excel interacts with VSTO SE on my
computer and I was wondering if anyone had any idea how I could fix
it. If I create an Excel addin it wont load in excel. But if I
create that same addin for any of the other office products it loads
fine. For instance:

Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup

Me.Application =
CType(Microsoft.Office.Tools.Excel.ExcelLocale1033Proxy.Wrap(GetType(Excel.Application),
Me.Application), Excel.Application)

MsgBox("Hello")

End Sub

This code starts an Excel App but no message box is displayed. But If
I run the following code on any of the other supported office products
the message box pops up when the app is loaded.


Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup

MsgBox("Hello")

End Sub


Can someone please tell me what I need to do in order to get my excel
working properly? It is far and away the office app that I program
the most with. Thanks!
 
A

Andrei Smolin

Are you sure that the add-in is loaded in Excel?

Do you see the add-in in the COM Add-ins dialog in Excel?

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com
 
N

NickP

Hi there,

Put a try catch block around the "me.application =" line and msgbox
the exception...

Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup

try
Me.Application =
CType(Microsoft.Office.Tools.Excel.ExcelLocale1033Proxy.Wrap(GetType(Excel.Application),Me.Application),
Excel.Application)
catch ex as exception
msgbox(ex.tostring())
end try

MsgBox("Hello")

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top