Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

src23 (Programmer)
16 Aug 04 14:08
HI !

Does anyone know how to get the IP address of a computer using VBA ?

I made log table, I have the back-end database on a server, and a few front-end files in the office, and i want to log all the users who access the back-end.

I used the Environ function, it provides me the computer name / user name and anything else i need, but it doesn't show the IP address. The functions I made are working, all I need is to get the IP address..

Please, I need urgent answer to this question ...

I couldn't do any search in this forum because this function is not available when i'm writing the message. I rmember i found a post on this forum some time ago about how to find the IP address, I looked after it but i
didnt find anything.... or maybe it wasn't on this forum...

If you can't answer but if you could give me the link to that post, or any ohter link, that would be great, too...

Thanx a lot !!!!
Helpful Member!(2)  PHV (MIS)
16 Aug 04 14:51
This is the function I personnally use:
Public Function getMyIP()
Dim myWMI As Object, myobj As Object, itm
Set myWMI = GetObject("winmgmts:\\.\root\cimv2")
Set myobj = myWMI.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each itm In myobj
  getMyIP = itm.IPAddress(0)
  Exit Function
Next
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244

(Programmer)
17 Aug 04 3:18
Thank you very much, PHV !

It works fine, it's exactly what I was looking for !

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close