Monday, January 3, 2011

Macro to Run a Query using SiteAdmin API

Dim result As String
Const m_SERVER As String = "QC URL"
Const m_USER As String = "Admin User Name"
Const m_PASS As String = "Password"

Sub RunQuery()
  
     ttt.Login m_SERVER, m_USER, m_PASS
    ' loop through excel data
    ' process users
    Sheets("Runquery").Select
    Range("A1").Select
    Selection.End(xlDown).Select
    '
    Dim i As Integer
    Dim j As Integer
    '
    i = ActiveCell.Row
    For j = 2 To i
        Sheets("Runquery").Select
        Dim result
                   
      result = ttt.RunQuery(Cells(j, 1), Cells(j, 2), Cells(j, 3), 25, 0)
                  
    Next
    ' logout
    ttt.Logout
End Sub
        

No comments:

Post a Comment