Hi Guys,
Can you advise me on how to detect user IP address.
If it is possible thru vba, please send me a sample code.
Many thanks in advance.
Rgds, Harto
Hi Guys,
Can you advise me on how to detect user IP address.
If it is possible thru vba, please send me a sample code.
Many thanks in advance.
Rgds, Harto
check this link out http://puremis.net/excel/code/079.shtml
This shorter version works for me
[vba]
Set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig In IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
Debug.Print IPConfig.IPAddress(i)
Next
End If
Next
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Dear All,
Thanks a lot. That's work fine.
unbelievable, bob! you are a master.
Best,
Harto
Originally Posted by xld
What reference in VBA should we use for this to work?
Sincerely,
DragonLancer
/me gives bob stars
Cordially,
Aaron
Keep Our Board Clean!
- Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
- Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.