ExportingmodulesfromExcel andimporting*.BAStoan Outlookstandalone license:
OptionExplicit'RequireVariable Declaration
PublicStopNowAsBoolean
DimStatus,ComPref,RMA,ETA As String
DimArrStatuses(),OnHoldMatrix(),TextAsString
DimCaseQuery,SVOResolve,SVOStatusAsObject
DimStatusQty,HeaderQty,Indices_TD_OnHoldMatrix(),i,uniq_i,j,m, n,nnAs Integer
DimTickIt,ClickAcceptAsBoolean
ConstUniqueStr= "Unassigned(PrmGen):PrmException("
ConstUniqueHeader="RMA/SVO#"
ConstUniqueLen= 36
ConstAcceptButton= "accept"
ConstSpaceString= " " ' itis unique thata new row of HTML table starts witha space
'ConstHold_ContactCustomer="Contact Customer"
ConstHold_ContactCustomer="AwaitLabor B2b ConfirmEsc"
ConstServiceRegion_Japan="Japan"
'**********************************
ConstCiscoLogin= "https://www.cisco.com/auths/forms/CDClogin.fcc?"'FormsCredential Controller
ConstuserID= "userInput"'inputfield
Constpassword= "passwordInput"'inputfield
Constloginbutton="login-button"'loginbutton
ConstmyCCO= "avymysli":ConstmyPW="Convergys03"
Private Subis_busy(ByVal internet)
Withinternet
Do While .Busy:DoEvents:Loop
Do While .ReadyState <>4: DoEvents:Loop
End With
DoEvents
Application.Wait(Now+TimeValue("0:00:3"))
End Sub
PublicSubScanningQueueForHold()
'On Error GoTo xyz
StopNow= False
Do While StopNow=False
SetSVOResolve=Nothing
If SVOResolve IsNothingThen
SetSVOResolve=CreateObject("InternetExplorer.Application")
End If
WithSVOResolve
.Left= 50
.Top = 50
.Height= 800
.Width= 1000
.MenuBar= 0
.Toolbar= 1
.StatusBar= 0
.Navigate "C:UsersAlesDesktopsvoresolve.htm"
'.Navigate "http://tools.cisco.com/serviceordertools/svoresolve/logon.do"
Do While SVOResolve.BusyAndNotSVOResolve.ReadyState=4: DoEvents:Loop
.Visible=1
End With
On Error Resume Next
'check logintoCisco
'login_domain : "https://www.cisco.com"
'login_target : "https://www.cisco.com/auths/setTargetCCO.html"
'bringsme here:
'https://www.cisco.com/auths/forms/CDClogin.fcc?TYPE=33619969&REALMOID=06-a0cd8fb0-a1d5-
1039-90c9-
83846dc90000&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=$SM$j43DnjO6UcZy5Uh
BHA2BIceJdrXGg0ZtxplLywmpPH%2f1QpkVVAvF5vZ0pU21szJG&TARGET=$SM$https%3a%2f%2fwww%
2ecisco%2ecom%2fauths%2fsetTargetCCO%2ehtml
'https://www.cisco.com/auths/forms/CDClogin.fcc?
Call is_busy(SVOResolve)
WithSVOResolve.Document
.getElementById(userID).Value =myCCO
On Error Resume Next
.getElementById(password).Value=myPW
On Error Resume Next
.getElementById(loginbutton).Click
On Error Resume Next
End With
Call is_busy(SVOResolve)
'clickon Prm Exception:
'RUN the JAVASCRIPTFunctionfromwithinVBA (Functionis:
setFilterQueue('queuesForm','PRM_GEN:PRM_EX') inthe HTML code)
SVOResolve.Document.all.Item
Call
SVOResolve.Document.parentWindow.execScript("setFilterQueue('queuesForm','PRM_GEN:PRM_EX')",
"JavaScript")
'it will refreshandnavigate here:
"http://tools.cisco.com/serviceordertools/svoresolve/FilteringAndQueuesGo.do"
Call is_busy(SVOResolve)
i = 0 'Index_<TD>= 0
Do While Text<> UniqueStr
Text= SVOResolve.Document.all.tags("td")(i).innerTEXT
If Mid(Text,1, UniqueLen) =UniqueStrThen
'returnsthe UniqueStrof the UniqueLenandcomparesitto the Const
StatusQty= Val(Mid(Text,UniqueLen+1))
'returnsthe rest of the string,startingat UniqueLen+1character,
'and convertsanynumerical value
Text= UniqueStr
End If
i = i + 1
Loop
If StatusQty> 0 Then
Do While Text<> UniqueHeader
Text= SVOResolve.Document.all.tags("td")(i).innerTEXT
uniq_i = i
i = i + 1
Loop
If Text= UniqueHeaderThen'e.g.if Text=RMA/SVO#
'read headersintoanarray until yougetsome true like 8digitnumberoremptystring
'thenwe have the unique index valuetostartreadingthe matrix from
HeaderQty= 1
'*******************************************************
m = 0
Do While Text<> SpaceString
ReDimPreserve OnHoldMatrix(StatusQty,HeaderQty - 1) 'firstrow reservedforheaders ->donot
decrementrowindex
OnHoldMatrix(m, HeaderQty - 1) = Text
ReDimPreserve Indices_TD_OnHoldMatrix(StatusQty,HeaderQty - 1)
Indices_TD_OnHoldMatrix(m,HeaderQty - 1) = i - 1
Text= SVOResolve.Document.all.tags("td")(i).innerTEXT'nextcell
i = i + 1
HeaderQty= HeaderQty+ 1
Loop
'*******************************************************
HeaderQty= HeaderQty - 1 ' correctionfor HeaderQty
For m = 1 To StatusQty
For n = 0 To HeaderQty - 1
Text= SVOResolve.Document.all.tags("td")(i).innerTEXT'nextcell
If Text= SpaceStringThen'readnextcell
i = i + 1
Text= SVOResolve.Document.all.tags("td")(i).innerTEXT
End If
OnHoldMatrix(m, n) =Text
Indices_TD_OnHoldMatrix(m,n) =i
i = i + 1
Nextn
Nextm
'*******************************************************
End If
End If
TickIt= True
For m = 1 To StatusQty
For n = 0 To HeaderQty - 1
If Mid(OnHoldMatrix(m,n),1,Len(Hold_ContactCustomer))=Hold_ContactCustomerThen
For nn = 0 To HeaderQty - 1
If OnHoldMatrix(m,nn) =ServiceRegion_JapanThen
TickIt= False
End If
Nextnn
If TickIt = True Then
i = Indices_TD_OnHoldMatrix(m, n)
SVOResolve.Document.getElementsByTagName("td")(i- (n+
1)).getElementsByTagName("input")(0).Checked=True
End If
End If
Nextn
Nextm
Call is_busy(SVOResolve)
'indexingstartsfrom0. There are only2 formsinthe html doc,so index is0 and 1. We need:
.getElementsByTagName("Form")(1)
'we search forinputtype = 'accept' tag/acceptbuttonthroughall formsuntil the endof document.Then
clickthe button
i = 0
j = 0
Text= ""
ClickAccept=False
Do While ClickAccept=False Ori <= SVOResolve.Document.forms.Length - 1
'For i = 0 To SVOResolve.Document.forms.Length - 1
'For j = 0 To SVOResolve.Document.forms(i).elements.Length - 1
Do Until LCase(Text) =AcceptButton Orj > SVOResolve.Document.forms(i).elements.Length - 1
Text= SVOResolve.Document.forms(i).elements(j).Value
If LCase(Text) =AcceptButtonThen
SVOResolve.Document.getElementsByTagName("Form")(i).getElementsByTagName("Input")(j).Click
Call is_busy(SVOResolve)
'we need:
SVOResolve.Document.getElementsByTagName("Form")(1).getElementsByTagName("Input")(4).Click
ClickAccept=True
End If
j = j + 1
Loop
i = i + 1
j = 0
'Nextj
'Nexti
Loop
'or: SVOResolve.Document.getElementsByName("accept").Item(0).Click
' RMA validation:
' If Len(Text) =8 And Val(Left(Text,1)) =8 Then
' ItIsNot_RMA_number= False
' EndIf
Call is_busy(SVOResolve)
Loop
End Sub

©️ CISCO RMA Service Order Status Business Function

  • 1.
    ExportingmodulesfromExcel andimporting*.BAStoan Outlookstandalonelicense: OptionExplicit'RequireVariable Declaration PublicStopNowAsBoolean DimStatus,ComPref,RMA,ETA As String DimArrStatuses(),OnHoldMatrix(),TextAsString DimCaseQuery,SVOResolve,SVOStatusAsObject DimStatusQty,HeaderQty,Indices_TD_OnHoldMatrix(),i,uniq_i,j,m, n,nnAs Integer DimTickIt,ClickAcceptAsBoolean ConstUniqueStr= "Unassigned(PrmGen):PrmException(" ConstUniqueHeader="RMA/SVO#" ConstUniqueLen= 36 ConstAcceptButton= "accept" ConstSpaceString= " " ' itis unique thata new row of HTML table starts witha space 'ConstHold_ContactCustomer="Contact Customer" ConstHold_ContactCustomer="AwaitLabor B2b ConfirmEsc" ConstServiceRegion_Japan="Japan" '********************************** ConstCiscoLogin= "https://www.cisco.com/auths/forms/CDClogin.fcc?"'FormsCredential Controller ConstuserID= "userInput"'inputfield Constpassword= "passwordInput"'inputfield Constloginbutton="login-button"'loginbutton ConstmyCCO= "avymysli":ConstmyPW="Convergys03"
  • 2.
    Private Subis_busy(ByVal internet) Withinternet DoWhile .Busy:DoEvents:Loop Do While .ReadyState <>4: DoEvents:Loop End With DoEvents Application.Wait(Now+TimeValue("0:00:3")) End Sub PublicSubScanningQueueForHold() 'On Error GoTo xyz StopNow= False Do While StopNow=False SetSVOResolve=Nothing If SVOResolve IsNothingThen SetSVOResolve=CreateObject("InternetExplorer.Application") End If WithSVOResolve .Left= 50 .Top = 50 .Height= 800 .Width= 1000 .MenuBar= 0 .Toolbar= 1 .StatusBar= 0 .Navigate "C:UsersAlesDesktopsvoresolve.htm"
  • 3.
    '.Navigate "http://tools.cisco.com/serviceordertools/svoresolve/logon.do" Do WhileSVOResolve.BusyAndNotSVOResolve.ReadyState=4: DoEvents:Loop .Visible=1 End With On Error Resume Next 'check logintoCisco 'login_domain : "https://www.cisco.com" 'login_target : "https://www.cisco.com/auths/setTargetCCO.html" 'bringsme here: 'https://www.cisco.com/auths/forms/CDClogin.fcc?TYPE=33619969&REALMOID=06-a0cd8fb0-a1d5- 1039-90c9- 83846dc90000&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=$SM$j43DnjO6UcZy5Uh BHA2BIceJdrXGg0ZtxplLywmpPH%2f1QpkVVAvF5vZ0pU21szJG&TARGET=$SM$https%3a%2f%2fwww% 2ecisco%2ecom%2fauths%2fsetTargetCCO%2ehtml 'https://www.cisco.com/auths/forms/CDClogin.fcc? Call is_busy(SVOResolve) WithSVOResolve.Document .getElementById(userID).Value =myCCO On Error Resume Next .getElementById(password).Value=myPW On Error Resume Next .getElementById(loginbutton).Click On Error Resume Next End With Call is_busy(SVOResolve) 'clickon Prm Exception:
  • 4.
    'RUN the JAVASCRIPTFunctionfromwithinVBA(Functionis: setFilterQueue('queuesForm','PRM_GEN:PRM_EX') inthe HTML code) SVOResolve.Document.all.Item Call SVOResolve.Document.parentWindow.execScript("setFilterQueue('queuesForm','PRM_GEN:PRM_EX')", "JavaScript") 'it will refreshandnavigate here: "http://tools.cisco.com/serviceordertools/svoresolve/FilteringAndQueuesGo.do" Call is_busy(SVOResolve) i = 0 'Index_<TD>= 0 Do While Text<> UniqueStr Text= SVOResolve.Document.all.tags("td")(i).innerTEXT If Mid(Text,1, UniqueLen) =UniqueStrThen 'returnsthe UniqueStrof the UniqueLenandcomparesitto the Const StatusQty= Val(Mid(Text,UniqueLen+1)) 'returnsthe rest of the string,startingat UniqueLen+1character, 'and convertsanynumerical value Text= UniqueStr End If i = i + 1 Loop If StatusQty> 0 Then Do While Text<> UniqueHeader Text= SVOResolve.Document.all.tags("td")(i).innerTEXT uniq_i = i i = i + 1 Loop
  • 5.
    If Text= UniqueHeaderThen'e.g.ifText=RMA/SVO# 'read headersintoanarray until yougetsome true like 8digitnumberoremptystring 'thenwe have the unique index valuetostartreadingthe matrix from HeaderQty= 1 '******************************************************* m = 0 Do While Text<> SpaceString ReDimPreserve OnHoldMatrix(StatusQty,HeaderQty - 1) 'firstrow reservedforheaders ->donot decrementrowindex OnHoldMatrix(m, HeaderQty - 1) = Text ReDimPreserve Indices_TD_OnHoldMatrix(StatusQty,HeaderQty - 1) Indices_TD_OnHoldMatrix(m,HeaderQty - 1) = i - 1 Text= SVOResolve.Document.all.tags("td")(i).innerTEXT'nextcell i = i + 1 HeaderQty= HeaderQty+ 1 Loop '******************************************************* HeaderQty= HeaderQty - 1 ' correctionfor HeaderQty For m = 1 To StatusQty For n = 0 To HeaderQty - 1 Text= SVOResolve.Document.all.tags("td")(i).innerTEXT'nextcell If Text= SpaceStringThen'readnextcell i = i + 1 Text= SVOResolve.Document.all.tags("td")(i).innerTEXT End If OnHoldMatrix(m, n) =Text Indices_TD_OnHoldMatrix(m,n) =i i = i + 1
  • 6.
    Nextn Nextm '******************************************************* End If End If TickIt=True For m = 1 To StatusQty For n = 0 To HeaderQty - 1 If Mid(OnHoldMatrix(m,n),1,Len(Hold_ContactCustomer))=Hold_ContactCustomerThen For nn = 0 To HeaderQty - 1 If OnHoldMatrix(m,nn) =ServiceRegion_JapanThen TickIt= False End If Nextnn If TickIt = True Then i = Indices_TD_OnHoldMatrix(m, n) SVOResolve.Document.getElementsByTagName("td")(i- (n+ 1)).getElementsByTagName("input")(0).Checked=True End If End If Nextn Nextm Call is_busy(SVOResolve) 'indexingstartsfrom0. There are only2 formsinthe html doc,so index is0 and 1. We need: .getElementsByTagName("Form")(1)
  • 7.
    'we search forinputtype= 'accept' tag/acceptbuttonthroughall formsuntil the endof document.Then clickthe button i = 0 j = 0 Text= "" ClickAccept=False Do While ClickAccept=False Ori <= SVOResolve.Document.forms.Length - 1 'For i = 0 To SVOResolve.Document.forms.Length - 1 'For j = 0 To SVOResolve.Document.forms(i).elements.Length - 1 Do Until LCase(Text) =AcceptButton Orj > SVOResolve.Document.forms(i).elements.Length - 1 Text= SVOResolve.Document.forms(i).elements(j).Value If LCase(Text) =AcceptButtonThen SVOResolve.Document.getElementsByTagName("Form")(i).getElementsByTagName("Input")(j).Click Call is_busy(SVOResolve) 'we need: SVOResolve.Document.getElementsByTagName("Form")(1).getElementsByTagName("Input")(4).Click ClickAccept=True End If j = j + 1 Loop i = i + 1 j = 0 'Nextj 'Nexti Loop 'or: SVOResolve.Document.getElementsByName("accept").Item(0).Click
  • 8.
    ' RMA validation: 'If Len(Text) =8 And Val(Left(Text,1)) =8 Then ' ItIsNot_RMA_number= False ' EndIf Call is_busy(SVOResolve) Loop End Sub