Running Macros from VBA

With Analytics Edge Core Add-in v2.7.2 and higher, you can run an Analytics Edge macro (e.g. “MyMacro”) from Visual Basic for Applications (VBA), using code similar to the following:

    Dim a As String
    a = Application.Run("AnalyticsEdge.RunMacro", "MyMacro")

Be careful of code conflicts between your VBA functionality and the Analytics Edge macro.

For example, if you wanted to trigger a refresh of the macro “Traffic Sources!$A$10″* when the value in cell A1 changed, you could write:

Private Sub Worksheet_Change(ByVal Target As Range)
  Dim a As String
  If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
    a = Application.Run("AnalyticsEdge.RunMacro", "Traffic Sources!$A$10")
  End If
End Sub
  • this would be a default named macro created when the cell A10 was selected on the Traffic Sources worksheet.