Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default TreeView Error_SC

I'm using the tree view functionality, where the node values are
taken
from a cell. Using the following code,
With TreeView1.Nodes
..Clear
Set nodX = .Add(, , "CName",
Worksheets("Cert_Details").Range("C_Name").Value)
Set nodX = .Add("CName", tvwChild, "Path",
Worksheets("Cert_Path_module").Range("Path").Value )
Set nodX = .Add("Path", tvwChild, "Mod1",
Worksheets("Cert_Path_module").Range("Module_1").V alue)
Set nodX = .Add("Path", tvwChild, "Mod2",
Worksheets("Cert_Path_module").Range("Module_2").V alue)
Set nodX = .Add("Path", tvwChild, "Mod3",
Worksheets("Cert_Path_module").Range("Module_3").V alue)
Set nodX = .Add("Path", tvwChild, "Mod4",
Worksheets("Cert_Path_module").Range("Module_4").V alue)
Set nodX = .Add("Path", tvwChild, "Mod5",
Worksheets("Cert_Path_module").Range("Module_5").V alue)
Here is my question.
If i have few cells that do not have any values for
ex.Worksheets("Cert_Path_module").Range("Module_1" ).Value)... then i
want that tree node with this cell value to be deleted, rather than
having a blank tree node. Any Suggestions???


The Reply I got was:


Depending exactly what you are doing, you can probably simplify the
code
somewhat with a loop;
Dim i as long
with Worksheets("Cert_Path_module")
For i=1 to 10
With .Range("Module_" & i)
if .Value<"" Then
Set nodX = .Add("Path", tvwChild, "Mod" & i,....
....etc


Now my code looks like this


With Worksheets("Cert_Path_module")
For i = 1 To 5
With .Range("Module_" & i)
If .Range("Module_" & i).Values < "" Then
Set nodX = .Add("Path", tvwChild, "Mod",
Worksheets("Cert_Path_module").Range("Module_" & i).Value)
End If
End With
Next i
End With


But when the system executes
Set nodX = .Add("Path", tvwChild, "Mod",
Worksheets("Cert_Path_module").Range("Module_" & i).Value)


I get error


Run-time error '438':
Object doesn't support this property or method.


I need your help on this as well Norman, Thanks a lot


Regards,
Ram

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
TreeView Stephen[_22_] Excel Programming 2 October 10th 05 06:25 PM
TreeView Help Tony Excel Programming 0 September 21st 05 05:39 PM
Treeview Patrick Choi[_2_] Excel Programming 1 September 6th 04 08:29 AM
TreeView marijan glavac[_2_] Excel Programming 2 April 30th 04 07:28 AM
Treeview Max Scott Excel Programming 2 October 3rd 03 02:00 PM


All times are GMT +1. The time now is 08:52 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"