I tried to read the computer's Device ID and the code worked fine
However, when I tried it on my other computer, an error appeared
Unable to open registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\MachineId" for reading
This is the VBA code that I use
any idea ?
However, when I tried it on my other computer, an error appeared
Unable to open registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\MachineId" for reading
This is the VBA code that I use
VBA Code:
Sub Try()
Dim objShell As Object
Dim DeviceID As String
Set objShell = CreateObject("WScript.Shell")
DeviceID = VBA.Replace(VBA.Replace(objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient\MachineId"), "{", ""), "}", "")
End Sub
any idea ?