' ANALYSIS TOOLPAK - Excel AddIn
' The following function declarations provide interface between VBA and ATP XLL.
' These variables point to the corresponding cell in the Loc Table sheet.
Const XLLNameCell = "B8"
Const MacDirSepCell = "B3"
Const WinDirSepCell = "B4"
Const LibPathWinCell = "B10"
Const LibPathMacCell = "B11"
Dim DirSep As String
Dim LibPath As String
Dim AnalysisPath As String
Dim WorkbookName As String
Dim FunctionIDs(37, 0 To 1)
Private Function GetMacroRegId(FuncText As String) As String
For i = LBound(FunctionIDs) To UBound(FunctionIDs)
If (LCase(FunctionIDs(i, 0)) = LCase(FuncText)) Then
If (Not (IsError(FunctionIDs(i, 1)))) Then
GetMacroRegId = FunctionIDs(i, 1)
Exit Function
End If
End If
Next i
End Function
'Procedures
Sub Anova1(inprng As Variant, Optional outrng As Variant, Optional grouped As Variant, Optional labels As Variant, Optional alpha As Variant)
xAnova1 = Application.Run(GetMacroRegId("fnAnova1"), inprng, outrng, grouped, labels, alpha)
End Sub
Sub Anova1Q(Optional inprng As Variant, Optional outrng As Variant, Optional grouped As Variant, Optional labels As Variant, Optional alpha As Variant)
xAnova1Q = Application.Run(GetMacroRegId("fnAnova1Q"), inprng, outrng, grouped, labels, alpha)
End Sub
Sub Anova2(inprng As Variant, Optional outrng As Variant, Optional sample_rows As Variant, Optional alpha As Variant)
xAnova2 = Application.Run(GetMacroRegId("fnAnova2"), inprng, outrng, sample_rows, alpha)
End Sub
Sub Anova2Q(Optional inprng As Variant, Optional outrng As Variant, Optional sample_rows As Variant, Optional alpha As Variant)
xAnova2Q = Application.Run(GetMacroRegId("fnAnova2Q"), inprng, outrng, sample_rows, alpha)
End Sub
Sub Anova3(inprng As Variant, Optional outrng As Variant, Optional labels As Variant, Optional alpha As Variant)
xAnova3 = Application.Run(GetMacroRegId("fnAnova3"), inprng, outrng, labels, alpha)
End Sub
Sub Anova3Q(Optional inprng As Variant, Optional outrng As Variant, Optional labels As Variant, Optional alpha As Variant)
xAnova3Q = Application.Run(GetMacroRegId("fnAnova3Q"), inprng, outrng, labels, alpha)
End Sub
Sub Descr(inprng As Variant, Optional outrng As Variant, Optional grouped As Variant, Optional labels As Variant, Optional summary As Variant, Optional ds_large As Variant, Optional ds_small As Variant, Optional confid As Variant)
xDescr = Application.Run(GetMacroRegId("fnDescr"), inprng, outrng, grouped, labels, summary, ds_large, ds_small, confid)
End Sub
Sub DescrQ(Optional inprng As Variant, Optional outrng As Variant, Optional grouped As Variant, Optional labels As Variant, Optional summary As Variant, Optional ds_large As Variant, Optional ds_small As Variant, Optional confid As Variant)
xDescrQ = Application.Run(GetMacroRegId("fnDescrQ"), inprng, outrng, grouped, labels, summary, ds_large, ds_small, confid)
End Sub
Sub Expon(inprng As Variant, Optional outrng As Variant, Optional damp As Variant, Optional stderrs As Variant, Optional chart As Variant, Optional labels As Variant)
xExpon = Application.Run(GetMacroRegId("fnExpon"), inprng, outrng, damp, stderrs, chart, labels)
End Sub
Sub ExponQ(Optional inprng As Variant, Optional outrng As Variant, Optional damp As Variant, Optional stderrs As Variant, Optional chart As Variant, Optional labels As Variant)
xExponQ = Application.Run(GetMacroRegId("fnExponQ"), inprng, outrng, damp, stderrs, chart, labels)
End Sub
Sub Fourier(inprng As Variant, Optional outrng As Variant, Optional inverse As Variant, Optional labels As Variant)
xFourier = Application.Run(GetMacroRegId("fnFourier"), inprng, outrng, inverse, labels)
End Sub
Sub FourierQ(Optional inprng As Variant, Optional outrng As Variant, Optional inverse As Variant, Optional labels As Variant)
xFourierQ = Application.Run(GetMacroRegId("fnFourierQ"), inprng, outrng, inverse, labels)
End Sub
Sub Ftestv(inprng1 As Variant, inprng2 As Variant, Optional outrng As Variant, Optional labels As Variant, Optional alpha As Variant)
xFtestv = Application.Run(GetMacroRegId("fnFtestV"), inprng1, inprng2, outrng, labels, alpha)
End Sub
Sub FtestvQ(Optional inprng1 As Variant, Optional inprng2 As Variant, Optional outrng As Variant, Optional labels As Variant, Optional alpha As Variant)
xFtestvQ = Application.Run(GetMacroRegId("fnFtestVQ"), inprng1, inprng2, outrng, labels, alpha)
End Sub
Sub Histogram(inprng As Variant, Optional outrng As Variant, Optional binrng As Variant, Optional pareto As Variant, Optional chartc As Variant, Optional chart As Variant, Optional labels As Variant)
xHistogram = Application.Run(GetMacroRegId("fnHistogram"), inprng, outrng, binrng, pareto, chartc, chart, labels)
End Sub
Sub HistogramQ(Optional inprng As Variant, Optional outrng As Variant, Optional binrng As Variant, Optional pareto As Variant, Optional chartc As Variant, Optional chart As Variant, Optional labels As Variant)
xHistogramQ = Application.Run(GetMacroRegId("fnHistogramQ"), inprng, outrng, binrng, pareto, chartc, chart, labels)
End Sub