excelvbaexcel-2016imeideviceid

Device ID with Excel VBA


I would like to extract the IMEI number/Device ID from the computer using excel.

In CMD I can do it in this way: :netsh mbn sh interface" and from the list given I take the Device ID.

I was tryong to find something online but no luck so far, that's why I'm asking your help, maybe some of you knows where to search or how to start.

How can I do this with excel vba?


Solution

  • You can use the following and then use split function to extract what you need

    Option Explicit
    
    Public Sub TEST()
       Debug.Print CreateObject("wscript.shell").exec("cmd /V /C netsh mbn show interface").StdOut.ReadAll
    End Sub