How to get the Hard Drive Serial Number given by the Manufacturer with
How to get the Hard Drive Serial Number given by the Manufacturer with
(OP)
How to get the Hard Drive Serial Number given by the Manufacturer with VBA?
Please note that I need Number given by Manufacturer & not Hard drive serial number which is a random number that is generated by DOS or Windows every time you format your hard drive.
Thanks
Please note that I need Number given by Manufacturer & not Hard drive serial number which is a random number that is generated by DOS or Windows every time you format your hard drive.
Thanks
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
h
I have re-written it to work as an Excel UDF:
CODE
Dim obj As Object
Dim WMI As Object
Dim SNList() As String, i As Long, Count As Long
Set WMI = GetObject("WinMgmts:")
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
If obj.SerialNumber <> "" Then Count = Count + 1
Next
ReDim SNList(1 To Count, 1 To 1)
i = 1
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
SNList(i, 1) = obj.SerialNumber
i = i + 1
If i > Count Then Exit For
Next
GetPhysicalSerial = SNList
End Function
Paste into a VB code module, then enter =GetPhysicalSerial() anywhere on a worksheet. If you have more than one physical hard drive enter as an array function to return the serial number for each drive.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
Thanks a Lot. I like your http://newtonexcelbach.wordpress.com site also.
Nitin
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
I can't help there at the moment. I have never seen this object before, and I don't recall reading about it in any book I have. I can only suggest following up the links in the discussion I linked to in my previous post. If I have time to do some research myself I will post something on my blog, but I don't know when that will be.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: How to get the Hard Drive Serial Number given by the Manufacturer with
http://msdn.microsoft.com/en-us/library/aa394585
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/