{"id":19543087,"url":"https://github.com/excel-dna/registration","last_synced_at":"2025-09-09T18:12:38.202Z","repository":{"id":14852902,"uuid":"17576071","full_name":"Excel-DNA/Registration","owner":"Excel-DNA","description":"Registration helpers for Excel-DNA","archived":false,"fork":false,"pushed_at":"2025-02-10T19:36:21.000Z","size":4719,"stargazers_count":37,"open_issues_count":10,"forks_count":19,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-09-05T05:38:48.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Excel-DNA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-03-09T23:09:13.000Z","updated_at":"2025-03-17T15:39:20.000Z","dependencies_parsed_at":"2025-02-09T10:23:00.408Z","dependency_job_id":"8420fdd0-1df9-4eaa-b818-7459862e1831","html_url":"https://github.com/Excel-DNA/Registration","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Excel-DNA/Registration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excel-DNA%2FRegistration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excel-DNA%2FRegistration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excel-DNA%2FRegistration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excel-DNA%2FRegistration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Excel-DNA","download_url":"https://codeload.github.com/Excel-DNA/Registration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excel-DNA%2FRegistration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274340552,"owners_count":25267294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T03:17:17.220Z","updated_at":"2025-09-09T18:12:38.170Z","avatar_url":"https://github.com/Excel-DNA.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Excel-DNA Registration Helper\n=============================\n\nThis library implements helper functions to assist and modify the Excel-DNA function registration, by applying various transformations before the functions are registered.\n\nThe following transformations have been implemented:\n\nGeneration of wrapper functions for:\n\n- Functions returning Task\u003cT\u003e or IObservable\u003cT\u003e as asynchronous or RTD-based functions (including F# Async\u003cT\u003e functions)\n- Optional parameters (with default values), 'params' parameters and Nullable\u003cT\u003e parameters\n- Range parameters in Visual Basic functions\n\nExamples of general function transformations:\n\n- Logging / Caching / Timing handlers\n- Suppress in Function Arguments dialog\n\n_If you've previously used the CustomRegistration library, note that I've renamed and rearranged the project source, and renamed the output assembly from ExcelDna.CustomRegistration to ExcelDna.Registration. The last state of the project before the large-scale rearrangement is marked by the git tag **CustomRegistration_Before_Rename**, and can be retrieved from the release tab on GitHub._\n\n### Getting Started\nTo make a simple add-in that uses the Excel-DNA Registration extension to dynamically update the HelpTopic information for function registrations:\n\n1. Create a new C# Class Library (.NET Framework) project, e.g. called RegistrationHelpUpdate.\n2. Open the Package Manager Console.\n3. `PM\u003e Install-Package ExcelDna.AddIn`\n4. `PM\u003e Install-Package ExcelDna.Registration`\n5. Edit the RegistrationHelpUpdate-AddIn.dna file to add the ExplicitRegistration flag to the function library, and add the reference to the `ExcelDna.Registration` for packing:\n```xml\n\u003cDnaLibrary Name=\"RegistrationHelpUpdate Add-In\" RuntimeVersion=\"v4.0\"\u003e\n  \u003cExternalLibrary Path=\"RegistrationHelpUpdate.dll\" ExplicitExports=\"false\" ExplicitRegistration=\"true\" LoadFromBytes=\"true\" Pack=\"true\" /\u003e\n  \u003cReference Path=\"ExcelDna.Registration.dll\" Pack=\"true\" /\u003e\n\u003c/DnaLibrary\u003e\n```\n6. Insert the following code:\n```cs\nusing System.Linq;\nusing ExcelDna.Integration;\nusing ExcelDna.Registration;\n\nnamespace RegistrationHelpUpdate\n{\n    public class AddIn : IExcelAddIn\n    {\n        public void AutoOpen()\n        {\n            RegisterFunctions();\n        }\n\n        public void AutoClose()\n        {\n        }\n\n        public void RegisterFunctions()\n        {\n            // There are various options for wrapping and transforming your functions\n            // See the Source\\Samples\\Registration.Sample project for a comprehensive example\n            // Here we just change the attribute before registering the functions\n            ExcelRegistration.GetExcelFunctions()\n                             .Select(UpdateHelpTopic)\n                             .RegisterFunctions(); \n\n        }\n\n        public ExcelFunctionRegistration UpdateHelpTopic(ExcelFunctionRegistration funcReg)\n        {\n            funcReg.FunctionAttribute.HelpTopic = \"http://www.bing.com\";\n            return funcReg;\n        }\n    }\n\n    public class Functions\n    {\n        [ExcelFunction(HelpTopic =\"http://www.google.com\")]\n        public static object SayHello()\n        {\n            return \"Hello!!!\";\n        }\n    }\n}\n```\n7. Press F5 to compile and start in Excel.\n8. Start typing `=SayHello(` in a cell and press the Fx button to open the function wizard. Check that  the HelpTopic has been updated during registration to open Bing instead of Google.\n\nSee the add-ins in the Samples directory to see various registration update extensions.\n\n### Step-by-step for Visual Basic\n\nOnce you have a basic Visual Basic add-in working.\n\n1. From the NuGet Package Manager Console, (or the Manage NuGet Packages dialog): \n    PM\u003e  Install-Package ExcelDna.Registration.VisualBasic \n\n2. Fix up your .dna file by changing to ExplicitRegistration for your library registration, and packing the extra ExcelDna.Registration libraries: \n\n```xml\n        \u003cDnaLibrary Name=\"MyVisualBasic Add-In\" RuntimeVersion=\"v4.0\" \u003e \n          \u003cExternalLibrary Path=\"MyVisualBasic.dll\" ExplicitRegistration=\"true\" LoadFromBytes=\"true\" Pack=\"true\" /\u003e \n          \u003cReference Path=\"ExcelDna.Registration.dll\" Pack=\"true\" /\u003e \n          \u003cReference Path=\"ExcelDna.Registration.VisualBasic.dll\" Pack=\"true\" /\u003e \n        \u003c/DnaLibrary\u003e \n```\n\n3.Perform the explicit registration in your AutoOpen by calling ExcelDna.Registration.VisualBasic.PerformDefaultRegistration(): \n\n```vb\n        Imports ExcelDna.Integration \n        Imports ExcelDna.Registration.VisualBasic \n\n        Public Class MyAddIn \n                Implements IExcelAddIn \n\n                Public Sub AutoOpen() Implements IExcelAddIn.AutoOpen \n                        ' Code here will run eery time the add-in is loaded \n                        PerformDefaultRegistration() \n                End Sub \n\n                Public Sub AutoClose() Implements IExcelAddIn.AutoClose \n                        ' Code in here will run when the add-in is removed in the Add-Ins dialog, \n                        ' but not when Excel closes normally \n                End Sub \n        End Class \n\n\n    Public Function dnaTestParams(date1 As Date, ParamArray s() As String) As String \n        Return s.Length \n    End Function \n    \n    Public Function dnaTestOptional(date1 As Date, Optional head As Boolean = True) As String \n        Return head.ToString() \n    End Function \n```\n### Sample Projects\n\nSample projects for this library can be found in the [Excel-DNA Samples repository](https://github.com/Excel-DNA/Samples/tree/master/Registration.Sample).\n\n### _Registration [Error] Repeated function name..._\n_If you receive this error when opening your Excel addin, you need to add `ExplicitRegistration=\"true\"` to the `\u003cExternalLibrary Path=\"MyAddin.dll\"...` command in your .dna file_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcel-dna%2Fregistration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcel-dna%2Fregistration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcel-dna%2Fregistration/lists"}