Leonidas75
Board Regular
- Joined
- May 12, 2015
- Messages
- 52
Hello,
I have the following vba code to run avaya reports into excel, however i have 3 issues i need to resolve. The first is i require code to set a timezone other than the default setting and secondly, if i run a report for a day less than the 10th of any month, the report date comes out wrong.
ie: 08/05/2015 will come back with report date for 05/08/2015.
The 3rd issue is, is there a code where i can avoid entering the login id and password if i am already logged into avaya?
I have the following vba code to run avaya reports into excel, however i have 3 issues i need to resolve. The first is i require code to set a timezone other than the default setting and secondly, if i run a report for a day less than the 10th of any month, the report date comes out wrong.
ie: 08/05/2015 will come back with report date for 05/08/2015.
The 3rd issue is, is there a code where i can avoid entering the login id and password if i am already logged into avaya?
Code:
Public Sub CMSConn()
Dim cvsApp As Object
Dim cvsConn As Object
Dim cvsSrv As Object
Dim Rep As Object
Dim Info As Object, Log As Object, b As Object
Set cvsApp = CreateObject("ACSUP.cvsApplication")
Set cvsConn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsServer")
Set Rep = CreateObject("ACSREP.cvsReport")
serverAddress = "cms"
mydate = "23/04/2010"
UserName = "yourUserName"
passW = "yourPassword"
agentName = "agent Name"
If cvsApp.CreateServer(UserName, "", "", serverAddress, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.login(UserName, passW, serverAddress, "ENU") Then
On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Agent\Trace by Location")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The Report " & "Historical\Agent\Trace by Location" & " was not found on ACD 1", vbCritical Or vbOKOnly, "CentreVu Supervisor"
Else
Set Log = CreateObject("ACSERR.cvslog")
Log.AutoLogWrite "The Report " & "Historical\Agent\Trace by Location" & " was not found on ACD 1"
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then
Debug.Print Rep.SetProperty("Agent", agentName)
Debug.Print Rep.SetProperty("Dates", mydate)
Debug.Print Rep.SetProperty("Times", "00:00-23:59")
b = Rep.ExportData("", 9, 0, False, True, True)
Set wk = ThisWorkbook
wk.Sheets(1).Cells.ClearContents
wk.Sheets(1).Cells(1, 1).PasteSpecial
'b = Rep.ExportData(fileP, 9, 0, False, True, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
End If
End If
cvsConn.logout
cvsConn.Disconnect
cvsSrv.Connected = False
Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsConn = Nothing
Set cvsApp = Nothing
End Sub
Last edited by a moderator: