ActiveX Control Combo Box
On Feb 16, 3:52*pm, Kenneth Hobson
wrote:
Add the reference as commented.
Private Sub ComboBox1_GotFocus()
* ComboBox1.List = DriveList
End Sub
Function DriveList() As Variant
'add, Tools References... Microsoft Scipting Runtime
* Dim fso As New FileSystemObject
* Dim dic As New Scripting.Dictionary
* Dim d As Object
* For Each d In fso.Drives
* * dic.Add d.driveletter, vbNullString
* Next d
* DriveList = dic.Keys
End Function
Thanks for replying kenneth, your code is perfect but just small
question that your code is giving just the drives letters but if i
want letters and their names or description like ("F:\ [Home drive]")
etc then how can i get that.
|