


This will allow the functions to be called without any prefix, although including a reference to the file reminds people that the function is defined in a separate file. This can be done by selecting (Tools > References) within the Visual Basic Editor. You can alternatively add an explicit reference to the "atpvbaen.xls" file. The parameters passed in MUST ALWAYS be range objects and not just strings containing a range Call Msgbox(Application.Run("atpvbaen.xla!Complex",3,3)) = 3+3i You can also call these functions using the Application.Run("Function Name","Parameters") syntax although this is only available for backwards compatibility. These functions can be called in exactly the same way as the regular worksheet functions. If you are using Excel 2003, change the filename to "atpvbaen.xla". Application.Run "atpvbaen.xlam!Histogram", _ You can use the macro recorder to help pass in the correct parameters. This add-in actually just provides the interface for the "ANALY32.XLL" file and both these files can be found in the following folders:Įxcel 365 - C:\Program Files\Microsoft Office\Office16\Library\Analysis\Įxcel 2021 - C:\Program Files\Microsoft Office\Office16\Library\Analysis\Įxcel 2019 - C:\Program Files\Microsoft Office\Office16\Library\Analysis\Įxcel 2016 - C:\Program Files\Microsoft Office\Office15\Library\Analysis\ When the "Analysis-ToolPak - VBA" add-in is installed you will see an additional project in your project window called "ATPVBAEN.XLAM". You will receive a "Type Mismatch" error otherwise. You must also have the "Analysis-ToolPak" add-in installed in order for this to work.


You must have the "Analysis-ToolPak - VBA" add-in installed if you want to use any of the extra worksheet functions from your VBA code. When the "Analysis-ToolPak" add-in is installed you will see an additional project in your project window called "FUNCRES.XLAM".
