Hello Friends,
I am using the below code to return motherboard serial number & it works fine except on one machine where it returns only a comma ","
Can someone pls check why is this happening as the code is running perfectly fine on other machines
I am using the below code to return motherboard serial number & it works fine except on one machine where it returns only a comma ","
Can someone pls check why is this happening as the code is running perfectly fine on other machines
VBA Code:
Public Function MBSerialNumber() As String
Dim objs As Object
Dim obj As Object
Dim WMI As Object
Dim sAns As String
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
sAns = sAns & obj.SerialNumber
If sAns < objs.Count Then sAns = sAns & ","
Next
MBSerialNumber = sAns
End Function