Hiding AddIn Methods from Worksheet Functions But Exposing to VBA

G

Guest

Our Automation Add-In has some methods that return object types Excel not fit
for Excel (one of the methods retunrs a custom collection for example). Is
there some way to hide this method so the end user won't try and use it as a
worksheet function, yet have it visible so that it can be used in VBA where
such objects can be correctly used? As it is, it appears all public methods
are visible in both VBA and Excel Sheet Functions.
 
A

Ardus Petus

Either turn the Sub to Private,
or create a dummy argument that will keep it from being shown as executable.

HTH
 
M

Matthew Wieder

Making the method private hides it from VBA as well since it doesn't get
registed by COM so that won't work. What type of 'dummy argument' would
stop a method in an Automation Add-In from being shown as executable?
 
M

Matthew Wieder

I'm am in an "Automation Add-In" not an Excel VBA Add-In. Managed C#
code available in Excel XP and 2003.
 
B

Bob Phillips

Add

Option Private Module

to the head of the module. This will make all procedures private to the
project, i.e. any module in the project can use them, other projects (and
Excel) will not see them.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
M

Matthew Wieder

As I stated in my first post this is an Automation Add-In - managed C#
code; there is no module.
 
A

Ardus Petus

Any kind of argument, eg a boolean:
Public MySub(optional dummy as boolean)

HTH
 

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