AVAYA CMS Scripting through Excel VBA

shekhar_pc

Board Regular
Joined
Jan 29, 2006
Messages
185
Code:
Private Function CMSGetReport(sServerIP As String, iACD As Integer, sReportName As String, sProperty1Name As String, sProperty1Value As String, sProperty2Name As String, sProperty2Value As String, sExportName As String) As Boolean
Dim cvsApp As CVS.cvsApplication
Dim cvsConn As CVSCN.cvsConnection
Dim cvsSrv As CVSUPSRV.cvsServer
Dim Rep As CVSREP.cvsReport
Dim Info As Object, Log As Object, b As Object

Set cvsApp = New CVSUP.cvsApplication
If cvsApp.CreateServer(getusername(sServerIP), "", "", sServerIP, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.Login(getusername(sServerIP), getpassword(sServerIP), sServerIP, "ENU") Then

CMSGetReport = False

On Error Resume Next
    cvsSrv.Reports.ACD = iACD
    Set Info = cvsSrv.Reports.Reports(sReportName)
    If Info Is Nothing Then
        If cvsSrv.Interactive Then
            MsgBox "The Report " & sReportName & " was not found on ACD" & iACD & ".", vbCritical Or vbOKOnly, "CentreVu Supervisor"
        Else
            Set Log = CreateObject("CVSERR.cvslog")
            Log.AutoLogWrite "The Report " & sReportName & " was not found on ACD" & iACD & "."
            Set Log = Nothing
        End If
    Else
        b = cvsSrv.Reports.CreateReport(Info, Rep)
        If b Then
            Debug.Print Rep.SetProperty(sProperty1Name, sProperty1Value)
            Debug.Print Rep.SetProperty(sProperty2Name, sProperty2Value)
'            Debug.Print Rep.SetProperty(sProperty3Name, sProperty3Value)
            b = Rep.ExportData(sExportName, 9, 0, True, False, True)
            Rep.Quit
            CMSGetReport = True
            If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
            Set Rep = Nothing
        End If
    End If
    Set Info = Nothing
End If
End If
End Function

I got the above fuction from http://www.dbforums.com/archive/index.php/t-1003776.html. What it does is, it extracts reports from AVAYA CenterVu Supervisor 9.0 software used by call centers.

But when I used it in excel VBA, it gives me compile error "User-defined type not defined in the first line "Dim cvsApp As CVS.cvsApplication" when I try to call the function see my code below.

More info:

I searched few files on my comp in the C:\Program Files\Avaya\CentreVu Supervisor 9.0 directory and go to know that

cvsAPP is an .exe file
cvsConn is a .dll file
cvsSrv is an .exe file
CVSREP is an .exe file

Code:
Sub a()
Call CMSGetReport("172.18.3.60", 1, "Upstream Stats Rpt", "Date(s)", "03/01/06--1", "Split Numbers", "71;72;74;79;82;83", "m:\ReportsAutomation\abc.xls")
End Sub

How can I get rid of the error?

Note: The above function might not display properly due to word wrap
 
I changed the code per your instructions but I get

Run-time error '429':

ActiveX componenet can't create object

line: Set cvsApp = CreateObject("CVS.cvsApplication")

Looks like I haven't set the right references.

I went to Tools->References and selected the checked CVS Application Component and the location it is poiting out is c:\Program Files\Avaya\CentreVu Supervisor 9.0\cvsAPP.exe which is correct.

Then what I did was, went through all the controls in the references window and checked all of them that were pointing to c:\Program Files\Avaya\CentreVu Supervisor 9.0\ directory but still the same error.

What am I doing wrong?
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
In the original post:

Dim cvsApp As CVS.cvsApplication

Set cvsApp = New CVSUP.cvsApplication


Note that the server's names are different. (CVS and CVSUP)
I do not understand this syntax?

Try editing this line
Set cvsApp = CreateObject("CVS.cvsApplication")
by changing it to
Set cvsApp = CreateObject("CVSUP.cvsApplication")
 
Upvote 0
Yes, that did the trick but it does not create abc.xls file mentioned in the parameters of CMSGetReport()

I opened Windows Task Manager to see what is happenning when the code is running.

First it opens cvsAPP which I beleive is the .exe application file for the software, then it opens cvsServer and then it opens Report Engine. Looks like the report is generated but is not exported.

Can it be just copied to sheet1 instead of exporting?
 
Upvote 0
As for the actual functionality of this third party software, I'm clueless. You may need to visit a forum better suited for your software.
 
Upvote 0

Forum statistics

Threads
1,216,459
Messages
6,130,758
Members
449,588
Latest member
accountant606

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top