Private Sub Workbook_Open() If CheckAddin("ATPVBAEN.XLA") = False Then _ MsgBox "Please install Analysis ToolPak adding " & _ "before using macros in this workbook." End Sub Function CheckAddin(addname As String) As Boolean Dim ad As AddIn, res As Boolean res = False ' Check for the addin in the Addins collection. For Each ad In AddIns ' If found, return true. If ad.Name = addname Then res = True Next CheckAddin = res End Function