Doflamingo
Board Regular
- Joined
- Apr 16, 2019
- Messages
- 238
Hi all,
I have a problem with a treeview from a userform. I don't know why the list of the documents does not display in the treeview with that code
Normally the treeview should show the folders and files contained in ''Download'' given that I wrote the path... but VBA editor say ''Object not found''
Any idea for some who knows how TreeView works on VBA ?
I have a problem with a treeview from a userform. I don't know why the list of the documents does not display in the treeview with that code
Code:
Private Sub UserForm_Initialize()
pere = "C:\Users\AtivBook9\Downloads\"
If pere = "" Then Exit Sub
If pere = "C:\" Then Stop
Set tw = Me.TreeView1
p = InStrRev(pere, "\"): tmp = Mid(pere, p + 1)
tw.Nodes.Add("NoeudMat" & pere, tvwChild, "NoeudMat" & d.Path, tmp).Expanded = True
Set fs = CreateObject("Scripting.FileSystemObject")
Set dossier_racine = fs.GetFolder(pere)
Lit_dossier dossier_racine, 1
End Sub
Normally the treeview should show the folders and files contained in ''Download'' given that I wrote the path... but VBA editor say ''Object not found''
Any idea for some who knows how TreeView works on VBA ?