Registering a User Defined Function with Excel

Pages in this article

  1. Introduction
  2. How does it work?
  3. Setting things up
  4. Class Module
  5. VBA code
  6. Put to Use
  7. Wrap Up

Put to Use

Now that I've explained some of the internals of this method, let me finish by showing you how this is put to use in your project.

This requires the following steps:

Private Sub Workbook_Open()
    LoadFunctionDescriptions
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    UnLoadFunctionDescriptions
End Sub

Of course you can also use the old Auto_Open and Auto_Close subs in a normal module.

Next you fill in the details about your UDFs on the worksheet called FunctionList:

Some additional remarks:

Make sure you read the last page too, it contains an important warning!