ninelivesguy
New Member
- Joined
- Jul 12, 2011
- Messages
- 2
I have s spreadsheet where my team can enter skill changes per rep with a time stamp for implementation. It works very smoothly until it changes a skill for an agent on a call, then it gives 2 pop up confirmations from CMS, and VBA script pauses waiting for confirmation. This code below utilizes an existing connection from the main cms console:
Code:
Sub Skill(R As Integer)
Dim cvsApp As New ACSUP.cvsApplication
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim AgMngObj As acsaa.cvsAgentMgmt
Dim Rep As String
Dim N As Integer
Dim S As Integer
Dim T As Integer
Dim sWarn As String
Set cvsSrv = cvsApp.Servers(1)
Set AgMngObj = cvsSrv.AgentMgmt
Rep = Range("B" & R)
N = Fix(Range("E" & R & ":AA" & R).Cells.SpecialCells(xlCellTypeConstants).Count / 2)
T = 4
ReDim SetArr(N, 3)
For S = 1 To N
SetArr(S, 1) = Cells(R, T)
SetArr(S, 2) = Cells(R, T + 1)
SetArr(S, 3) = 0
T = T + 2
Next
On Error Resume Next
AgMngObj.AcdStartUp -1, "", cvsSrv.ServerKey, -1
AgMngObj.OleAgentSetSkill 2, Format(Rep, "0000000"), 1, 0, 0, 0, N, SetArr, sWarn
Set AgMngObj = Nothing
Err.Clear
Set cvsSrv = Nothing
Set cvsApp = Nothing
Range("AB" & R) = Now()
Application.Wait (Now + TimeValue("0:00:09"))
End Sub
</PRE>
Code:
Sub Skill(R As Integer)
Dim cvsApp As New ACSUP.cvsApplication
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim AgMngObj As acsaa.cvsAgentMgmt
Dim Rep As String
Dim N As Integer
Dim S As Integer
Dim T As Integer
Dim sWarn As String
Set cvsSrv = cvsApp.Servers(1)
Set AgMngObj = cvsSrv.AgentMgmt
Rep = Range("B" & R)
N = Fix(Range("E" & R & ":AA" & R).Cells.SpecialCells(xlCellTypeConstants).Count / 2)
T = 4
ReDim SetArr(N, 3)
For S = 1 To N
SetArr(S, 1) = Cells(R, T)
SetArr(S, 2) = Cells(R, T + 1)
SetArr(S, 3) = 0
T = T + 2
Next
On Error Resume Next
AgMngObj.AcdStartUp -1, "", cvsSrv.ServerKey, -1
AgMngObj.OleAgentSetSkill 2, Format(Rep, "0000000"), 1, 0, 0, 0, N, SetArr, sWarn
Set AgMngObj = Nothing
Err.Clear
Set cvsSrv = Nothing
Set cvsApp = Nothing
Range("AB" & R) = Now()
Application.Wait (Now + TimeValue("0:00:09"))
End Sub
</PRE>