Automation Add-in Shim

G

gauss

Hi,

I have seen the examples given by Whitechapel for shimming an automation
add-in (i.e. a COM add-in that defines UDF) But how to shim a function that
doesn't use simple types. e.g.
object Fucntion(Excel.Range rng); // C#

In the shim code, what types to use for "object" and "Excel.Range"? How to
reference the Typelib of excel in the shim?

thanks
 
P

Peter Huang [MSFT]

Dear Customer,

I understand you mean the Shim in the link below.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/htm
l/odc_shim.asp

As we know, in managed addin the acctually unmanaged stub to lauch .NET
addin is mscoree.dll.
So every Addin is actually attached to mscoree.dll to the office
application.

So the Shim is a replacement to the mscoree.dll it has the defined
interface by office application to load.
And then the Shim will lauch CLR to host managed code.

I just wonder why you need to expose your function only, because the
customized function code will not be called by office.

If I have any misunderstanding, please feel free to post there.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

gauss

Hi,

I was talking about these blogs:

http://blogs.officezealot.com/whitechapel/archive/2005/05/21/4728.aspx
http://blogs.officezealot.com/whitechapel/archive/2005/06/09/4756.aspx

I do understand the principle of shimming a COM add-in. But the special COM
add-ins for Excel (starting from Excel XP) , called automation add-in, that
defines Worksheet functions in Excel (UDF), define functions that are not in
the IDTExtensibility2 interface (and may not implement it at all).

So if the unmanaged shim doesn't define wrappers for the functions to be
exposed as UDF then they will not be visible to Excel, right?

regards


PS: I am working on VS2003 and Excel 2003 pro.
 
P

Peter Huang [MSFT]

Hi Gauss,

Thanks for your clarification.
Now I understand your scenario and I would do some research and update you
ASAP.

Thanks for your understanding!

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi Gauss,

Thanks for your quickly reply!
If you still have any concern, please feel free to post here.
I would like to be of assistance!

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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