Hi, I copied the code pasted below from Excel VBA help but it does not return the mapped drive letter just an empty string with other drive details.

public const pth = "\\server\share"

Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(pth))
s = "Drive " & d.DriveLetter & ": - "
s = s & d.VolumeName & vbCrLf
s = s & "Free Space: " & FormatNumber(d.FreeSpace / 1024, 0)
s = s & " Kbytes"
MsgBox s

my OS is Windows 7 SP 1, Excel 2007
Any help is appreciated, thanks.