' Listing 2: The checkSNMP Subroutine Sub checkSNMP On Error Resume Next Set objWMIService = nothing : Set colItems = nothing Set objWMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_Service where Name='" & strService & "'",,48) SNMPInstalled = False ' ******* BEGIN CALLOUT A ******* For Each objItem in colItems SNMPInstalled = True XL.Cells(Row,1).Value = strService & " SERVICE " XL.Cells(Row,Col).Value = Computer & " Started==>" & objItem.Started XL.Cells(Row,Col+1).Value = "StartMode==>" & objItem.StartMode XL.Cells(Row,Col+2).Value = "State==>" & objItem.State Row = Row + 1 ' ******* END CALLOUT A ******* ' ******* BEGIN CALLOUT B ******* If objItem.Started Or objItem.State = "Running" Then If PBL Then XL.ActiveWorkbook.Sheets(computer).Tab.ColorIndex = _ CRITICAL Else XL.ActiveWorkbook.Sheets(computer).Tab.ColorIndex = OK End If Else If PBL Then XL.ActiveWorkbook.Sheets(computer).Tab.ColorIndex = _ IMPORTANT Else XL.ActiveWorkbook.Sheets(computer).Tab.ColorIndex = _ INFORMATIONAL End If End If PBL = False Next If SNMPInstalled = False Then XL.ActiveWorkbook.Sheets(computer).Tab.ColorIndex = NOSNMP ' ******* END CALLOUT B ******* End If End Sub