The easy way would be to try them out for yourself
I haven't looked at the threads but this is the function I use. It works
Place it in a standard module
Code:
Function GetMyMACAddress() As String
'Declaring the necessary variables.
Dim strComputer As String
Dim objWMIService As Object
Dim colItems As Object
Dim objItem As Object
Dim myMACAddress As String
'Set the computer.
strComputer = "."
'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'A select query is used to get a collection of network adapters that have the property IPEnabled equal to true.
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
'Loop through all the collection of adapters and return the MAC address of the first adapter that has a non-empty IP.
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then myMACAddress = objItem.MACAddress
Exit For
Next
'Return the IP string.
GetMyMACAddress = myMACAddress
' Debug.Print GetMyMACAddress
End Function
The easy way would be to try them out for yourself
I haven't looked at the threads but this is the function I use. It works
Place it in a standard module
Code:
Function GetMyMACAddress() As String
'Declaring the necessary variables.
Dim strComputer As String
Dim objWMIService As Object
Dim colItems As Object
Dim objItem As Object
Dim myMACAddress As String
'Set the computer.
strComputer = "."
'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'A select query is used to get a collection of network adapters that have the property IPEnabled equal to true.
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
'Loop through all the collection of adapters and return the MAC address of the first adapter that has a non-empty IP.
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then myMACAddress = objItem.MACAddress
Exit For
Next
'Return the IP string.
GetMyMACAddress = myMACAddress
' Debug.Print GetMyMACAddress
End Function