Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Need help with Treeview control ??

Hi there I am extreamly frustrated because I have recently discoverd the
treeview control but am unable to use it. I have found nothing in the Excel
VBA help files of use and every search I have done for a example code has
been either far to complex or had errors in in it before I edited anything.
Could someone please help me with a small very very very basic example code
for populating and using the Treeview control on a vba form.

Thanks, Dan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help with Treeview control ??

http://support.microsoft.com/default...b;en-us;244954
How To Populate a Treeview Control with an XML File

The treeview control is not distributed with microsoft office, so you
wouldn't expect to find anything about it in the help files for excel.

--
Regards,
Tom Ogilvy

"Dan Thompson" wrote in message
...
Hi there I am extreamly frustrated because I have recently discoverd the
treeview control but am unable to use it. I have found nothing in the

Excel
VBA help files of use and every search I have done for a example code has
been either far to complex or had errors in in it before I edited

anything.
Could someone please help me with a small very very very basic example

code
for populating and using the Treeview control on a vba form.

Thanks, Dan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Need help with Treeview control ??

Well that may be true however I have added The treeview control to my forms
toolbox and have such added the control to my form I am able to refference it
withing Excel VBA code too for example

With Me
Treview1.Nodes.Add(blah blah blah)
end with
but when I add the nodes and run the control on my form nothing happens
I know that this control can be used in a Excel VBA form.
Im just not sure how to get it going has anyone used this control on a Excel
VBA form before that can help me with a small working sample ?

Thanks Dan Thompson



"Tom Ogilvy" wrote:

http://support.microsoft.com/default...b;en-us;244954
How To Populate a Treeview Control with an XML File

The treeview control is not distributed with microsoft office, so you
wouldn't expect to find anything about it in the help files for excel.

--
Regards,
Tom Ogilvy

"Dan Thompson" wrote in message
...
Hi there I am extreamly frustrated because I have recently discoverd the
treeview control but am unable to use it. I have found nothing in the

Excel
VBA help files of use and every search I have done for a example code has
been either far to complex or had errors in in it before I edited

anything.
Could someone please help me with a small very very very basic example

code
for populating and using the Treeview control on a vba form.

Thanks, Dan




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Need help with Treeview control ??

Hi Dan

Short explanation of the Blah blah part:

Nodes.Add(Key of parent node, relation to parent node, unique node key, node
text, optional icon to display)

Private Sub UserForm_Initialize()
Dim L1 As Long, L2 As Long
With Me.TreeView1
Dim NodX As Node
Set NodX = .Nodes.Add(, , "Root", "My main node")
Set NodX = Nothing
For L1 = 1 To 6
Set NodX = .Nodes.Add("Root", tvwChild, _
"Sub" & L1, "Child " & L1)
NodX.EnsureVisible
Set NodX = Nothing
For L2 = 1 To 12
Set NodX = .Nodes.Add("Sub" & L1, tvwChild, _
"Sub" & L1 & "sub" & L2, "Grandhild " & L1)
Set NodX = Nothing
Next
Next
End With
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
If Node.Key = "Root" Then
MsgBox "I'm root."
Else
MsgBox "You just clicked " & Node.Key & ", proud child of the great " &
_
Node.Parent.Key
End If
End Sub

HTH. Best wishes Harald

"Dan Thompson" skrev i melding
...
Well that may be true however I have added The treeview control to my

forms
toolbox and have such added the control to my form I am able to refference

it
withing Excel VBA code too for example

With Me
Treview1.Nodes.Add(blah blah blah)
end with
but when I add the nodes and run the control on my form nothing happens
I know that this control can be used in a Excel VBA form.
Im just not sure how to get it going has anyone used this control on a

Excel
VBA form before that can help me with a small working sample ?

Thanks Dan Thompson



"Tom Ogilvy" wrote:

http://support.microsoft.com/default...b;en-us;244954
How To Populate a Treeview Control with an XML File

The treeview control is not distributed with microsoft office, so you
wouldn't expect to find anything about it in the help files for excel.

--
Regards,
Tom Ogilvy

"Dan Thompson" wrote in message
...
Hi there I am extreamly frustrated because I have recently discoverd

the
treeview control but am unable to use it. I have found nothing in the

Excel
VBA help files of use and every search I have done for a example code

has
been either far to complex or had errors in in it before I edited

anything.
Could someone please help me with a small very very very basic example

code
for populating and using the Treeview control on a vba form.

Thanks, Dan






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Need help with Treeview control ??

Thanks Harald
That worked GREAT!
You were a big help, realy apreciate your input.

Dan


"Harald Staff" wrote:

Hi Dan

Short explanation of the Blah blah part:

Nodes.Add(Key of parent node, relation to parent node, unique node key, node
text, optional icon to display)

Private Sub UserForm_Initialize()
Dim L1 As Long, L2 As Long
With Me.TreeView1
Dim NodX As Node
Set NodX = .Nodes.Add(, , "Root", "My main node")
Set NodX = Nothing
For L1 = 1 To 6
Set NodX = .Nodes.Add("Root", tvwChild, _
"Sub" & L1, "Child " & L1)
NodX.EnsureVisible
Set NodX = Nothing
For L2 = 1 To 12
Set NodX = .Nodes.Add("Sub" & L1, tvwChild, _
"Sub" & L1 & "sub" & L2, "Grandhild " & L1)
Set NodX = Nothing
Next
Next
End With
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
If Node.Key = "Root" Then
MsgBox "I'm root."
Else
MsgBox "You just clicked " & Node.Key & ", proud child of the great " &
_
Node.Parent.Key
End If
End Sub

HTH. Best wishes Harald

"Dan Thompson" skrev i melding
...
Well that may be true however I have added The treeview control to my

forms
toolbox and have such added the control to my form I am able to refference

it
withing Excel VBA code too for example

With Me
Treview1.Nodes.Add(blah blah blah)
end with
but when I add the nodes and run the control on my form nothing happens
I know that this control can be used in a Excel VBA form.
Im just not sure how to get it going has anyone used this control on a

Excel
VBA form before that can help me with a small working sample ?

Thanks Dan Thompson



"Tom Ogilvy" wrote:

http://support.microsoft.com/default...b;en-us;244954
How To Populate a Treeview Control with an XML File

The treeview control is not distributed with microsoft office, so you
wouldn't expect to find anything about it in the help files for excel.

--
Regards,
Tom Ogilvy

"Dan Thompson" wrote in message
...
Hi there I am extreamly frustrated because I have recently discoverd

the
treeview control but am unable to use it. I have found nothing in the
Excel
VBA help files of use and every search I have done for a example code

has
been either far to complex or had errors in in it before I edited
anything.
Could someone please help me with a small very very very basic example
code
for populating and using the Treeview control on a vba form.

Thanks, Dan









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Need help with Treeview control ??

"Dan Thompson" skrev i melding
...
Thanks Harald
That worked GREAT!
You were a big help, realy apreciate your input.


Glad to hear that Dan. Thanks for the feedback.
Best wishes Harald


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
refreshing a treeview control. Steven Deng Excel Programming 2 November 9th 04 07:23 PM
Treeview Control populating Joe O. Excel Programming 2 May 5th 04 01:04 PM
How to use Treeview control with Imagelist kvenku[_2_] Excel Programming 0 April 7th 04 01:52 PM
TreeView Control Andy Excel Programming 0 January 28th 04 12:01 PM
TreeView control Mike Caputo Excel Programming 3 November 14th 03 09:35 PM


All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"