Excel Pragma

January 19, 2005

Create your own Add-In

Filed under: User-Defined Functions, Utilities — Admin @ 8:16 am

You’ve started creating your functions and you’re very proud of the results. Now you want to have them as standard functions in Excel. I recommend to create an Excel Add-In where you can store all your functions and procedures, and have them accessible from the main application window or from your code. Be careful though if you’re redistributing your work.

The following example will guide  you through creating the Pragma Add-In and calling the Test procedure from Excel.

1– Create a new workbook.

2– Open the Visual Basic Editor (Alt + F11)

3– Add a module to your workbook  : in the Project Explorer, right-click on any of the objects in the workbook and select Insert –> Module

InsertModule

4– Add the following procedure in the Visual Basic Editor :

Sub Test()
    MsgBox “Pragma”
End Sub

5– From the main application window (Excel), save your workbook as

     FileName = “Pragma” unless you really don’t like the name. really.

     Save As Type = Microsoft Excel Add-In (*.xla)

6– Still from the main application window, go to Tools —> Add-Ins and then browse to the folder where you saved the Add-In and select it.

7– Technically you’re done but if you want to test the Add-In, press Alt+F8. The procedure you’ve just created will not appear in the list so you need to type “test” (Macro Name) and Run.

1 Comment

  1. […] OutStrEnd Function And here’s the output :   Obviously, this now goes into the add-in you created . and will also be part of my Utilities projec […]

    Pingback by Excel Pragma » Concatenate with Separators — February 3, 2005 @ 12:55 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress