Hiding Multiple .NET Functions from Excel's Function Wizard

Oct 2, 2010 at 11:12 AM

How do I hide all shared functions in a class from Excel's function wizard without the hassle of putting a "IsHidden" (as below) on top of each function?

The functions currently appear under the category that is named after my project. If hiding is not possible, then is it possible to apply the same category for all functions inside a class with just one line of code?

<ExcelFunction(IsHidden:=True)> _

Public Shared Function TheFunc()

return 1

End Function
Oct 2, 2010 at 11:23 AM


If you want only functions marked with <ExcelFunction...> attributes to be registered with Excel, you can add an ExplicitExports="true" attribute to the Project or ExternalLibrary tag in the ExcelDna file. There is a small example called ExplicitExports in the Distribution\Samples directory. Unlike functions marked by IsHidden:=True, functions that are not registered cannot be called using Application.Run from VBA.

You can also mark functions as internal or private, and they will not be registered by Excel-Dna.

The category is set to the DnaLibrary name by default, and can only be overridden per method.



Oct 2, 2010 at 12:00 PM

Thanks! I now changed my TEST.dna file to the below so it only registers the functions that I want registered.

<ExternalLibrary Path="TEST.dll" ExplicitExports="true" />