I need to pull out the IP address into a VBA macro. This code works but the command dialogue is briefly visible which is not a good look. Can I use a modification to do it \
I think this may be easier, it uses WMI.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration", , 48)
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then
''Commented line
''Debug.Print "IPAddress: " & Join(objItem.IPAddress, ",")
''Message box
MsgBox "IPAddress: " & Join(objItem.IPAddress, ",")
''String for later use
strIPAddress = strIPAddress & Join(objItem.IPAddress, ",")
End If
Next
''Later
SynapseForm.LabelIP.Caption = strIPAddress