View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rowan[_2_] Rowan[_2_] is offline
external usenet poster
 
Posts: 226
Default How do I obtain the drive serial number in EXCEL spreadsheet

Try:

Sub DriveSerial()

Dim fs As Object
Dim d As Object

Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName _
(fs.GetAbsolutePathName(ThisWorkbook.Path)))
MsgBox d.SerialNumber

End Sub

Hope this helps
Rowan

"Paul Ramirez" wrote:

How can I obtain the serial number of a drive that a spreadsheet is
installed on from within the same EXCEL spreadsheet?