Hello VB gurus. Hope you are well.
Spot the deliberate mistake...
Whenever I run this, I get "Runtime error '13' - Type Mismatch" at "Set fo = fso.GetFolder(DirName)". DirName is (example) "E:\". This is an EXACT word-for-word copy from another application that works, just this one doesn't. Can anyone tell me why? I'm going rapidly mad.Code:Private Sub ShowFolders(ByVal DirName As String) Dim fso As New FileSystemObject, fld As Folder, flds As Folders Dim fo As Folder Set fo = fso.GetFolder(DirName) Set flds = fo.SubFolders For Each fld In flds tvTreeView.Nodes.Add DirName, tvwChild, fld.Name, fld.Name Next Set fo = Nothing Set flds = Nothing End Sub
Thank you very much
T




Reply With Quote