View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Blair Blair is offline
external usenet poster
 
Posts: 9
Default VBA Code return value in Excel

Hello, I am trying to run the following code to return the serial number of
the hard drive i.e. a unique identifier . is it possible to amend this code
to return the serial number as a value in a particular excel cell?

Thanks very much for your help

Sub SerialNumber()
Dim oFSO As Object
Dim drive As Object

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set drive = oFSO.GetDrive("C:\")
MsgBox drive.SerialNumber

Set oFSO = Nothing
Set drive = Nothing
'release memory

End Sub