Excel H/D Serial Number (resolved)
I need some help with this. I use this code to get the serial number of my drive. Works well in XP, does not work in 98. I need a code that will work for all windows versions. Any suggestions? This is run by my autoopen subroutine in Excel 97.
VB Code:
Private Sub snumber()
' checks serial number of hard disk and stores to name value
Dim fso, d
Dim s As Long
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(Left(ThisWorkbook.Path, 2))
s = d.serialnumber
Names.add Name:="SerialNumber", RefersTo:=Abs(s), Visible:=False
End Sub
Thanks.