Computing.Net > Forums > Programming > Visual Basic Application

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Visual Basic Application

Reply to Message Icon

Name: maheshbabu
Date: May 2, 2009 at 00:22:41 Pacific
OS: Windows XP
CPU/Ram: pentium(R)3.00GHz/1.99GB
Product: Microsoft / 2003
Subcategory: Opinions
Comment:

I am working on VBA.
I am selecting a Board file loading the data into treeview(Here Busname as Parent and Net Name as Child nodes)simultaniously I am tracking the duplicates(Netnames) and loading the duplicates into Listview control,Now i need display the duplicates in Treeview itselef.I am Posting the code,List view have 4 lines code.I need to replace this Listbox code with Treeviecode

Private Sub cmdSelectFile_Click()
Temp = ClearContents()
Temp = ColumnHeader()
txtFilePath.Text = Application.GetOpenFilename(FileFilter:="Board Files (*.brd), *.brd", Title:="Please select a Board file")
dummy = GetNetNameAndFillTree()
End Sub
'-------------------------
Private Function GetNetNameAndFillTree()
'imgProcessing.Visible = True
treeBusNode.Nodes.Clear
Dim DuplicateNetName As Boolean
Dim strNetName As String
DuplicateNetName = False
lstNetName.Clear
FullFileName = ActiveWorkbook.Path & "\" & "NetName.txt"

Set objReport = New Report
If CheckBox1.Value = False Then
If Len(Dir(FullFileName)) > 0 Then
    Kill (FullFileName)
End If
strTemp = "cmd /c extracta " & Chr(34) & txtFilePath.Text & Chr(34) & "  " & Chr(34) & ActiveWorkbook.Path & "\" & "CommandTemplate.txt" & Chr(34) & "  " & Chr(34) & ActiveWorkbook.Path & "\" & "NetName.txt" & Chr(34)
Temp = Shell(strTemp, vbHide)
Application.Wait DateAdd("s", 5, Now)
End If
strFileContent = objReport.GetReport(ActiveWorkbook.Path & "\" & "NetName.txt")
myArray = Split(strFileContent, vbCrLf)
myArrayLength = UBound(myArray) - LBound(myArray) + 1
strTemp = ""
DuplicateNetName = False
 For i = 0 To myArrayLength - 1 Step 1
  If myArray(i) <> "" And Mid(myArray(i), 1, 2) = "S!" Then
    strNetName = Split(myArray(i), "!")(1)
       If strTemp <> strNetName And strNetName <> "" Then
'----------------------------ListView Code Starts from here--------------------------------
	(Please not for your reference Listbox Name is lstNetName)
                 For j = 0 To lstNetName.ListCount - 1
                 If lstNetName.List(j) = strNetName Then
                       DuplicateNetName = True
                         End If
                         Next j            
               If DuplicateNetName = False Then
             lstNetName.AddItem (Split(myArray(i), "!")(1))
'-------------------------------------------------------------------------------------------------------------------------------
            treeBusNode.Nodes.Add Key:=CStr(Split(myArray(i), "!")(1)) & "_Key", Text:=CStr(Split(myArray(i), "!")(1))
            UpdateTree (Split(myArray(i), "!")(1))
            strTemp = Split(myArray(i), "!")(1)
        End If
                DuplicateNetName = False
            End If
    End If
 Next i
'imgProcessing.Visible = False
End Function
.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Visual Basic Application

Mapping image location in Visual Basic www.computing.net/answers/programming/mapping-image-location-in-visual-basic/545.html

Visual Basic - Help on application www.computing.net/answers/programming/visual-basic-help-on-application/5838.html

List Databses is Visual Basic 6 www.computing.net/answers/programming/list-databses-is-visual-basic-6/15612.html