Treeview Hyperlink problem

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

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 ?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top