AutomationAddIn

Add-in Express™ Support Service
That's what is more important than anything else

AutomationAddIn
how to create an AutomationAddIn 
An Ngo




Posts: 12
Joined: 2006-02-21
Hi,
I see in the sample this an automation addin
(Advanced/Ecel worksheet function demo solution)
I want to creat a similar project (i.e. no command bar, but provide a function (MyFunc in the example), added by menu Tools/Add-Ins).
But when I use the template ADX COM Add-Ins I can't find any option to let me do that.
I go through the HOWTO sections, but there is nothing.

Could you tell me how to do that?
Thank you very much
Posted 25 Feb, 2006 02:03:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi An.

You just need to create a new 'Class Library' project in Visual Studio and then add a new 'COM Excel Add-in Module' via the 'Add New Item' dialog.
Posted 27 Feb, 2006 06:53:43 Top
An Ngo




Posts: 12
Joined: 2006-02-21
Ho Sergey,
Sorry to disturb you again
I did as you told me.
However, I still need to manually add

using Excel = Microsoft.Office.Interop.Excel;

and the reference
Excel (Microsoft Excel 11.0 Object Library)

otherwise the namespace Excel is not recognized

(your sample does not have "using Excel = ..., but the name of the Reference is Interop.Excel, I don't know if this is related VS 2005 and .NET framework 2.0. I have both installed).

But then, I cannot register this project. Always receive the message "... <my module>.dll does not contain any types that can be registered for COM interop".

Thank you




Posted 01 Mar, 2006 04:39:19 Top
An Ngo




Posts: 12
Joined: 2006-02-21
Hi,
I found a solution.
In the Assembly.cs file, there is a line

[assembly: ComVisible(false)]

This line must be commented out - or changed to

[assembly: ComVisible(true)]

---

But I think that you should update your wizard or at least update the document. It is kind of weird to have a wizard generates everything and then struggle to make it works.

Thank you very much
An
Posted 01 Mar, 2006 05:25:20 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi An.

I agree with you. I should add a standalone wizard to create Excel Automation add-ins.
Posted 01 Mar, 2006 09:10:07 Top