Hi all,
I'm after another bit of help if possible,
My plan ideally is that when my operatives are on site, they need to use their laptop to open a connection, below is the code I'm currently to force the connection, its also getting IP information from them.
However what I would like to achieve, is somehow, be able to use geocode, to get their co ordinates, and basically tell me the street location they were in at the time.
Does that make sense?
Any help appreciated.
Below is the code I'm currently running (apologies if its messy) I'm new to this!
Sub GetIPAddrInfo()
Application.EnableCancelKey = xlInterrupt
Dim response As Variant
Dim InBxloop As Boolean
Dim InBxloop1 As Boolean
Dim iRet As Integer
Dim strPrompt As String
Dim strTitle As String
Dim wbk1 As Workbook, wbk2 As Workbook
MyName = ThisWorkbook.Name
Dim strComputer As String
Dim objWMIService As Object
Dim colIPConfig As Object
Dim IPconfig As Object
Dim i As Integer
Range("A2").Select
Selection.ClearContents
Range("A2:A20").Select
Selection.ClearContents
Do
InBxloop = True
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colIPConfig = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPconfig In colIPConfig
If Not IsNull(IPconfig.IPAddress) Then
For i = LBound(IPconfig.IPAddress) To UBound(IPconfig.IPAddress)
ActiveCell = IPconfig.IPAddress(i)
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
Next
End If
Next
If Range("A5") <> "" Then
Exit Sub
End If
If Range("A2").Value = "" Then
MsgBox "Internet Required!"
Else
End If
Loop While InBxloop = True
Range("A:A").Select
Selection.Columns.AutoFit
Range("A1").Select
Range("A1").Value = Environ("Username")
End Sub
Bookmarks