xlDAX - how to use/install
In this article I explain how to make the add-in available to your workbooks.
As xlDAX.xlma is a VBA add-in you can install it, but, in general, utility add-ins like this, particularly when being used on a client-site, are best instantiated on a once-off, need-to-use basis.
- simply manually loading like a normal workbook OR …
Workbook.Open()event or macro OR …
- a macro associated with an button/control.
The code snippet below demonstrates one-off install of the add-in.
I assume the calling workbook shares the same folder as the add-in (often a good idea when packaging a client-site solution).
.Runcommand calls a macro called
loadHammer. This will attempt to load my
.NETHAMMER add-in, if it exists in the same folder as the xlDAX.xlma file, if not, only thing that’ll happen is the loading of xlDAX. I’ll explain later on, why sometimes you might need HAMMER, but in most cases you’ll not.
Sub init_xlDAX() Dim xlDAXFile As String Dim workingFolder As String 'Set whatever working folder you require workingFolder = ActiveWorkbook.Path xlDAXFile = workingFolder & "\" & "xlDAX.xlam" xlDAXFile = "'" & xlDAXFile & "'!" & "loadHammer" Application.Run (xlDAXFile) End Sub