Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Question CMS agent change skills through VBA/Excel

  • Doctore
  • Topic Author
  • Visitor
  • Visitor
8 years 5 months ago #562 by Doctore
Hi Guys,
I know that there is plenty of usefull information in this forum, however I couldnt find anything that could help me solve my issue.
I am trying to build an excel-VBA code, to read agent extension, skill number and skill level (from Excel sheet) and apply the changes in CMS.

The biggest problem I am facing is how to read and add arrays based on amount of skill numbers entered in excel. So far I have this:

I'll be happy to provide more details of what I need :)

Dim cvsApp As Object, cvsSrv As Object, cvsconn As Object, INFO As Object, cvsRepProp As Object, cvsLog As Object
Dim bConnected As Boolean, b As Boolean
Dim iServer As Integer
Dim ACD As String
Dim SRVR As String
Dim VDN As String
Dim agents As String
Dim SetArr() As Variant
Dim sWarn As String
Dim skills As Integer
Dim level As Integer

Sub ChangeSkills()

agents = Range("B2")
skills = Range("C2")
level = Range("D2")


ReDim SetArr(1, 4)
SetArr(1, 1) = skills
SetArr(1, 2) = level
SetArr(1, 3) = 0
SetArr(1, 4) = 0


Set cvsApp = CreateObject("ACSUP.cvsApplication")
Set cvsconn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsServer")

On Error Resume Next
bConnected = False
Set cvsSrv = cvsApp.Servers(1)
If Err = 5 Then
If MsgBox("I don't see a CMS Server application running. Please log in and try again", vbOKOnly, "No CMS Supervisor!") = vbOK Then End
End If
If cvsApp.Servers(1).ServerKey Like "*\cmsserver\*\*\*" Then
bConnected = True
End If
If bConnected = False Then
If MsgBox("no connection", vbOKOnly, "Another Security Warning") = vbOK Then End
End If
'Change Skills#
On Error Resume Next

cvsSrv.AgentMgmt.AcdStartUp -1, "", cvsSrv.ServerKey, -1
cvsSrv.AgentMgmt.OleAgentSetSkill 1, "" & agents & "", 1, 0, 0, 0, 1, SetArr, ""
Set AgMngObj = Nothing

cvsSrv.Connected = False
Set cvsSrv = Nothing
Set cvsconn = Nothing
Set cvsApp = Nothing

End Sub

Please Log in or Create an account to join the conversation.

More
8 years 5 months ago #563 by roller
I assume you the three logic to loop through the additional skills. From there use redim preserve for your array to add a new skill in (2,4) and so on. Redim preserve allows you to extend the array without losing the existing data.

Please Log in or Create an account to join the conversation.

  • Doctore
  • Topic Author
  • Visitor
  • Visitor
8 years 5 months ago #564 by Doctore
Replied by Doctore on topic CMS agent change skills through VBA/Excel
Thank you very much for your quick answer Roller !

Could you give me an example of the formula ?

Please Log in or Create an account to join the conversation.

More
8 years 5 months ago #565 by roller
There is an old post here that cover probably what you need, did you read this:

fracta.net/fracta/index.php/forum/2-exce...aya-cms?limitstart=0

Please Log in or Create an account to join the conversation.

Time to create page: 0.550 seconds
Powered by Kunena Forum