Try code like the following in the userform that contains the TreeView:
Private Sub CommandButton1_Click()
Dim TopFolderStr As String
Dim TopFolder As Scripting.Folder
Dim FSO As Scripting.FileSystemObject
Dim TopNode As Node
TopFolderStr = "C:\TopLevelFolder"
Set FSO = New Scripting.FileSystemObject
Set TopFolder = FSO.GetFolder(TopFolderStr)
Set TopNode = UserForm1.TreeView1.Nodes.Add(Text:=TopFolder.Name)
DoFolder FSO, UserForm1.TreeView1, TopFolder, TopNode
End Sub
Private Sub DoFolder(FSO As Scripting.FileSystemObject, _
TVX As TreeView, WhatFolder As Scripting.Folder, _
WhatFolderNode As Node)
Dim FF As Scripting.Folder
Dim F As Scripting.File
Dim FFNode As Node
Dim FNode As Node
Dim SubFF As Scripting.Folder
For Each FF In WhatFolder.SubFolders
Set FFNode = TVX.Nodes.Add(WhatFolderNode, tvwChild, , FF.Name)
For Each F In FF.Files
Set FNode = TVX.Nodes.Add(FFNode, tvwChild, , F.Name)
Next F
For Each SubFF In WhatFolder.SubFolders
DoFolder FSO, TVX, FF, FFNode
Next SubFF
Next FF
End Sub

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
> Hi I have been trying to load folder and sub folders and file, I can first
> level folders but having problem trying to get second etc.
> If anybody could it would be much appreciated.
> Charles
Thanks Chip I do have one question when I run the code I get duplicate
Folders [6 times] I have stepped through the code but can't see where it's
doing it?
Regards
Charles
PS I like the code I was using different function to try and do the same
thing.
> Hi I have been trying to load folder and sub folders and file, I can first
> level folders but having problem trying to get second etc.
> If anybody could it would be much appreciated.
> Charles
vqthomf - 14 Sep 2007 13:18 GMT
Thamks Chip I have work out what was caused the Dups I removed For Each SubFF
In WhatFolder.SubFolders and it was okay
Regards
Charles
> Thanks Chip I do have one question when I run the code I get duplicate
> Folders [6 times] I have stepped through the code but can't see where it's
[quoted text clipped - 8 lines]
> > If anybody could it would be much appreciated.
> > Charles
Chip Pearson - 14 Sep 2007 14:26 GMT
> Thamks Chip I have work out what was caused the Dups I removed For Each
> SubFF
> In WhatFolder.SubFolders and it was okay
You need that code if you are looping through an arbitrary level of nest
folders and files.

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
> Thamks Chip I have work out what was caused the Dups I removed For Each
> SubFF
[quoted text clipped - 16 lines]
>> > If anybody could it would be much appreciated.
>> > Charles