Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removable drives
Hi,
Is there a piece of code to check that a removable drive is there or not. Thanks MarkS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removable drives
Couple of functions you should be able to adapt Tim From: http://msdn.microsoft.com/library/de...us/script56/ht ml/jscoldrives.asp Function ShowDriveList Dim fso, d, dc, s, n Set fso = CreateObject("Scripting.FileSystemObject") Set dc = fso.Drives For Each d in dc n = "" s = s & d.DriveLetter & " - " If d.DriveType = 3 Then ' n = d.ShareName ElseIf d.IsReady Then n = d.VolumeName Else n = "[Drive not ready]" End If s = s & n & vbcrlf Next ShowDriveList = s End Function Function ShowDriveType(drvpath) Dim fso, d, t Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(drvpath) Select Case d.DriveType Case 0: t = "Unknown" Case 1: t = "Removable" Case 2: t = "Fixed" Case 3: t = "Network" Case 4: t = "CD-ROM" Case 5: t = "RAM Disk" End Select ShowDriveType = "Drive " & d.DriveLetter & ": - " & t End Function "MarkS" wrote in message ... Hi, Is there a piece of code to check that a removable drive is there or not. Thanks MarkS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mapped vs Network drives | Excel Worksheet Functions | |||
Network Drives | New Users to Excel | |||
hyperlinks in different drives | Excel Discussion (Misc queries) | |||
Excel 2003 SP 1 does not search for files on a removable HDD | Excel Discussion (Misc queries) | |||
Network drives | Excel Programming |