Hi...
I have this code i got offline... i cannot figure out why it won't work. I am currently using Excel 2013 with Avaya CMS Supervisor R17.
When the code is finished executing, the output into excel sheet is the path of the report instead of the data that i am querying from that system... it should be the report data that report generates.
Can anyone take a look at the code and see if anything stands out... i have been looking at it for 3 hours now. Thanks in advance for your help.
I have this code i got offline... i cannot figure out why it won't work. I am currently using Excel 2013 with Avaya CMS Supervisor R17.
When the code is finished executing, the output into excel sheet is the path of the report instead of the data that i am querying from that system... it should be the report data that report generates.
Can anyone take a look at the code and see if anything stands out... i have been looking at it for 3 hours now. Thanks in advance for your help.
Code:
Dim d As String
Sub getACD()
Dim cvsApp As Object
Dim cvsConn As Object
Dim cvsSrv As Object
Dim Rep As Object
Dim Info As Object, b As Object
Dim dt As Date
Set cvsApp = CreateObject("ACSUP.cvsApplication")
Set cvsConn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsServer")
Set Rep = CreateObject("ACSREP.cvsReport")
serverAddress = ThisWorkbook.Sheets("Panel").Cells(1, 2)
UserName = ThisWorkbook.Sheets("Panel").Cells(2, 2)
Password = ThisWorkbook.Sheets("Panel").Cells(3, 2)
If cvsApp.CreateServer(UserName, "", "", serverAddress, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.login(UserName, Password, serverAddress, "ENU") Then
On Error Resume Next
cvsSrv.Reports.acd = 6
r = 7
Do While ThisWorkbook.Sheets("Panel").Cells(r, 1) <> ""
Set Info = cvsSrv.Reports.Reports(ThisWorkbook.Sheets("Panel").Cells(r, 1))
If Info Is Nothing Then
MsgBox "The automated report was not found on ACD 1."
Else
b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then
If ThisWorkbook.Sheets("Panel").Cells(r, 2) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 2).Text, ThisWorkbook.Sheets("Panel").Cells(r, 3).Text
If ThisWorkbook.Sheets("Panel").Cells(r, 4) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 4).Text, ThisWorkbook.Sheets("Panel").Cells(r, 5).Text
If ThisWorkbook.Sheets("Panel").Cells(r, 6) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 6).Text, ThisWorkbook.Sheets("Panel").Cells(r, 7).Text
b = Rep.ExportData("", 9, 0, False, False, True)
lr = ThisWorkbook.Sheets(ThisWorkbook.Sheets("Panel").Cells(r, 8).Text).Range("a65536").End(xlUp).Row
ThisWorkbook.Sheets(ThisWorkbook.Sheets("Panel").Cells(r, 8).Text).Cells(lr + 1, 1).PasteSpecial
Rep.Quit
End If
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
r = r + 1
Loop
Set Info = Nothing
End If
End If
Set cvsApp = Nothing
Set cvsConn = Nothing
Set cvsSrv = Nothing
Set Rep = Nothing
End Sub