R
ravi_cpt
hi,
i have a EXCEL template file which loads a VBA dialog containing
TREEVIEW control and IMAGELIST.
i use the following code
Private Sub UserForm_Initialize()
ImageList1.ListImages.Add 1, , LoadPicture("e:\sclose.ico")
ImageList1.ListImages.Add 2, , LoadPicture("e:\sopen.ico")
Set TreeView1.ImageList = ImageList1
With TreeView1
.Nodes.Clear
.Nodes.Add , , "Root", "Venku", LoadPicture("e:\sclose.ico")
LoadPicture("e:\sopen.ico")
.Nodes.Add "Root", tvwChild, "XX", "Shruthik"
.Nodes.Add , , "Root1", "Mouna"
End With
End Sub
but i am getting an error :
Invalid Object while @ Set TreeView1.ImageList = ImageList1
can anybody suggest me whats wrong with this code.
thanks
-ravi
Attachment filename: book1.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=61292
i have a EXCEL template file which loads a VBA dialog containing
TREEVIEW control and IMAGELIST.
i use the following code
Private Sub UserForm_Initialize()
ImageList1.ListImages.Add 1, , LoadPicture("e:\sclose.ico")
ImageList1.ListImages.Add 2, , LoadPicture("e:\sopen.ico")
Set TreeView1.ImageList = ImageList1
With TreeView1
.Nodes.Clear
.Nodes.Add , , "Root", "Venku", LoadPicture("e:\sclose.ico")
LoadPicture("e:\sopen.ico")
.Nodes.Add "Root", tvwChild, "XX", "Shruthik"
.Nodes.Add , , "Root1", "Mouna"
End With
End Sub
but i am getting an error :
Invalid Object while @ Set TreeView1.ImageList = ImageList1
can anybody suggest me whats wrong with this code.
thanks
-ravi
Attachment filename: book1.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=61292