0

In the contact center where I work, they gave me a payroll with information based on agents and the skills that correspond to each one of them. I need to create a VBA code so that changes made in that payroll are automatically replicated in CMS Supervisor and the agent will be enabled to receive calls under the corresponding skill. For your reference, I've attached a picture of how my payroll looks like.Payroll

I found a couple codes but they don't match with the payroll I have.

  • Since avaya is rare and not everyone can help you, I can give you the code to do the changing skills, but how to get them and all that you will have to do your own research. – Damian May 06 '19 at 19:27

1 Answers1

0

This is how my worksheet looks like:

Skills management

And this is the code which will change the skills for everyone (they will only have the ones here at the end, this doesn't add skills)

This is my code:

Option Explicit
Dim cvsApp As New ACSUP.cvsApplication
Dim cvsConn As New ACSCN.cvsConnection
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim Rep As New ACSREP.cvsReport
Sub SkillAgentes()


    Application.ScreenUpdating = False
    Set cvsSrv = cvsApp.Servers(1)

    Dim LastRow As Long, LastCol As Long
    Dim ws As Worksheet
    Dim F As Integer, C As Integer, i As Integer, S As Integer, Prtr As Integer, ACD As Integer
    Dim Skill As String, Agentes As String
    Dim SetArr() As Variant
    Dim AgMngObj As Object

    Set ws = ThisWorkbook.Sheets("Cambios Skill")
    Set AgMngObj = cvsSrv.AgentMgmt


    LastRow = ws.Range("B" & ws.Rows.Count).End(xlUp).Row
    ACD = 2
    For i = 2 To LastRow
        S = 1
        LastCol = ws.Cells(i, 2).End(xlToRight).Column
        Agentes = ws.Cells(i, ws.Cells.Find("login").Column)
        ReDim SetArr((LastCol - 2) / 2, 4)
        For C = 3 To LastCol Step 2
            On Error Resume Next
            Skill = ws.Cells(i, C)
            Prtr = ws.Cells(i, C + 1)
            SetArr(S, 1) = Skill
            SetArr(S, 2) = Prtr
            SetArr(S, 3) = 0
            SetArr(S, 4) = 0
            S = S + 1
        Next C
        AgMngObj.AcdStartUp -1, "", cvsSrv.ServerKey, -1
        AgMngObj.OleAgentSetSkill_R16_1 ACD, Agentes, 1, 0, 0, 0, S - 1, SetArr, ""
    Next i

    ThisWorkbook.Save

    MsgBox "Agentes puestos en sus skill de origen."


End Sub

Note: for this to work you need to check these libraries (the ones with "FALTA") Libraries

Note2: this works for an interactive app, so Avaya must be open and an user logged in.

Damian
  • 5,152
  • 1
  • 10
  • 21