2

I am a newbie in macro moreso using macro to access websites but I need a code to click a tree node. The HTML code is:

<html id="ext-gen3" class=" ext-strict x-viewport" decorator="blank">
    <head></head>
    <body id="ext-gen4" class="ext-gecko ext-gecko3 cwc-view x-border-layout-ct" onload="cwc.getFrameworkWindow()">
        <div id="cwc_header" class=" masthead x-border-panel" style="left: 0px; top: 0px; width: 1428px; height: 27px;"></div>
        <div id="cwcNavPanel" class=" x-panel cwc-navPanel x-border-panel" style="width: 220px; left: 0px; top: 56px;">
            <div id="ext-gen17" class="x-panel-bwrap">
                <div id="ext-gen18" class="x-panel-tbar x-panel-tbar-noheader" style="width: 220px;"></div>
                <div id="ext-gen19" class="x-panel-body x-panel-body-noheader" style="width: 218px; height: 490px;">
                    <div id="cwcAccordionNav" class=" x-panel x-panel-noborder" style="width: 218px;">
                        <div id="ext-gen44" class="x-panel-bwrap">
                            <div id="ext-gen45" class="x-panel-body x-panel-body-noheader x-panel-body-noborder" style="overflow: auto; width: 218px; height: 490px;">
                                <div id="ROOT/Favorites and Dashboards" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Change_/Fulfillment Tasks" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Change Management" class="x-panel x-panel-noborder x-tree" style="width: auto;">
                                    <div id="ext-gen84" class="x-panel-header x-panel-header-noborder x-unselectable x-accordion-hd" style="-moz-user-select: none; cursor: pointer;"></div>
                                    <div id="ext-gen85" class="x-panel-bwrap" style="display: block; visibility: visible; position: static; left: 0px; top: 0px; z-index: auto;">
                                        <div id="ext-gen86" class="x-panel-body x-panel-body-noborder" style="width: auto; height: auto;">
                                            <ul id="ext-gen87" class="x-tree-root-ct x-tree-arrows">
                                                <div class="x-tree-root-node">
                                                    <li class="x-tree-node"></li>
                                                    <li class="x-tree-node">
                                                        <div id="ROOT/Change Management/Open New Change" class="x-tree-node-el x-tree-node-leaf x-unselectable" unselectable="on" ext:tree-node-id="ROOT/Change Management/Open New Change">
                                                            <span class="x-tree-node-indent"></span>
                                                            <img class="x-tree-ec-icon x-tree-elbow" src="/SM/js/extjs/resources/images/default/s.gif" alt=""></img>
                                                            <img class="x-tree-node-icon cwc-tree-noIcon-node" unselectable="on" src="/SM/js/extjs/resources/images/default/s.gif" alt=""></img>
                                                            <a class="x-tree-node-anchor" tabindex="1" href="" hidefocus="on">
                                                                <span unselectable="on" qtip="Open New Change"></span>
                                                            </a>
                                                        </div>
                                                        <ul class="x-tree-node-ct" style="display:none;"></ul>
                                                    </li>
                                                    <li class="x-tree-node"></li>
                                                </div>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div id="ROOT/Configuration Management" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Fulfillment Request" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Incident Management" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Knowledge Management" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Problem Management" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Service Desk" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="ROOT/Service Level Management" class="x-panel x-panel-noborder x-tree x-panel-collapsed" style="width: auto;"></div>
                                <div id="defaultTreePanelID" class="x-panel x-panel-noborder x-tree" style="width: auto;"></div>
                            </div>
                        </div>
                    </div>
                    <div id="cwcFavMgrPanel" class=" x-panel x-panel-noborder x-hide-display"></div>
                </div>
            </div>
        </div>
        <div id="cwcCenterPanel" class=" x-tab-panel cwc-centerPanel x-border-panel" style="left: 228px; top: 35px; width: 1200px;"></div>
        <!--

         Telephony Applet 

        -->
        <iframe id="ext-gen152" class="ext-shim" frameborder="0" src="/SM/js/extjs/resources/images/default/s.gif" style="display: none; visibility: visible; z-index: 20000; left: 118px; top: 202px; width: 108px; height: 35px;"></iframe>
        <div id="ext-gen153" class="x-shadow" style="z-index: 20001; left: 118px; top: 202px; width: 108px; height: 35px; display: none;"></div>
        <div id="ext-comp-808428" class="x-tip" style="position: absolute; z-index: 20002; visibility: hidden; width: 108px; left: 114px; top: 199px; display: none;"></div>
        <div id="cwcNavPanel-xsplit" class="x-layout-split x-layout-split-west x-splitbar-h" style="left: 220px; top: 56px; height: 520px;"></div>
        <div id="ext-gen50" class=" x-unselectable x-splitbar-proxy x-splitbar-proxy-h" style="-moz-user-select: none;"></div>
        <div id="ext-gen154" style="position: absolute; left: -1000px; top: -1000px; visibility:…; text-transform: none; letter-spacing: normal; width: auto;"></div>
    </body>
</html>

from the site, I want to click the one marked as "open new change". Below is the image of the site: https://drive.google.com/file/d/0B4YInJe_XRdfaERFOHl4Tnp5Zlk/edit?usp=sharing

From what i've read, this is what i need to do:

Sub TestLogin(user As String, pass As String)

    Dim IE As Object
    Dim objCol As Object

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    IE.Navigate "**************"

    WaitTilLoad IE

    IE.document.getElementByID("LoginUsername").Value = user
    IE.document.getElementByID("LoginPassword").Value = pass

    IE.document.getElementByID("loginBtn").Click

    WaitTilLoad IE
    WaitForSeconds 3

'THIS IS WHERE I NEED THE CODE. I DO NOT KNOW HOW TO ACCESS IT. BELOW IS NOT DOING ANYTHING
    IE.document.getElementByID("ROOT/Change Management/Open New Change").Click  

    WaitTilLoad IE
    WaitForSeconds 3

End Sub

I tried looking for answers in google but i dont know how to word my query or how to properly search to get more precise answers. Any help would be appreciated.

Thank you

1
  • Hi, anybody who can help at least point me in the right direction? Thanks. Aug 6, 2014 at 9:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.