Private Sub Command1_Click() Text1.Text = Replace(MACAddress, ":", "-") End Sub
Private Function MACAddress() As String Set objs = GetObject("winmgmts:").ExecQuery("SELECT MACAddress " & "FROM Win32_NetworkAdapter " & "WHERE " & "((MACAddress Is Not NULL) " & "AND (Manufacturer <> " & "'Microsoft'))") For Each obj In objs MACAddress = obj.MACAddress Exit For Next obj End Function