Treeview missing icons

B

Barry Gilbert

I have code that finds Excel files in a folder and fills a TreeView control.
It looks like this:

Set fso = New Scripting.FileSystemObject
If fso.FolderExists(path) Then ' path is passed into this function.
Set fldr = fso.GetFolder(path)
strFileFound = Dir(fso.BuildPath(fldr.path, "*.xls"))
Do While Len(strFileFound) <> 0
' Excel files are named like this: D1.HBU.Print.xls
' Extract the first part...
strProdCode = Left$(strFileFound, InStr(1, strFileFound, ".") - 1)
Me.tvwSetupSheets.Nodes.Add parentNode, tvwChild,
fso.BuildPath(path, strFileFound), strProdCode, "excel" ' This is an icon
in an ImageList control.
strFileFound = Dir()
Loop
Else

This work fine on most machines. However, I have one user for whom this
doesn't work. When this runs, it seems to create a node for each file, but
uses the folder icon instead of the excel icon and doesn't display the parsed
file name. It doesn't throw an error.

I've confirmed that the ActiveX controls are correctly installed and
registered on his machine and that he has rights to the folder.

He's running Access 2000 on WinXP Pro. I've tested this on other machines
with the same configuration and they seem to work.

Any suggestions are appreciated.
 
Top