Consulting

Results 1 to 4 of 4

Thread: How to get control of range input type from a webpage using VBA

  1. #1
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location

    Question How to get control of range input type from a webpage using VBA

    Hi Friends,
    I am workin on an automation where I have to provide input to a webpage in which a different control I saw which name is range input below is the html code for same.
    ONce user change range by dragging mouse one chart get updated.
    <div class="range">
                      <label for="score">scores</label>
                      <div class="labels">
                        <span>600</span>
                        <span class="max">850</span>
                      </div>
                      <input style="width: 1px; height: 1px; overflow: hidden; position: absolute; opacity: 0;" id="credit-score" value="700" type="range" step="20" max="840" min="600">
    				  <div id="js-rangeslider-1421669192041" class="rangeslider">
    				  <div style="width: 243.5px;" class="rangeslider__fill"></div>
    				  <div style="left: 232.5px;" class="rangeslider__handle"></div></div>
                      <div style="left: 223.49px;" id="slider-range" class="range-text">800 - 819
    </div>
                    </div>
    I am able to get control of this but some how even after assigning new value it not working and chart is not getting updated I am using below code for same.

    Set oTab1 = IE.Document.GetElementById("score")
    Set oTab = IE.Document.GetElementById("js-rangeslider-1421669192041")
    
    For Each oLink In oTab.all
        If InStr(1, oLink.outerhtml, "rangeslider__fill", vbTextCompare) Then
    
    
            oLink.Style.Width = "150.5px"
        ElseIf InStr(1, oLink.outerhtml, "rangeslider__handle", vbTextCompare) Then
    
    
            oLink.Style.left ="139.5px"
        End If
    Next
    '
    IE.Document.GetElementById("slider-range").Style.left =  "130.5px"
    IE.Document.GetElementById("slider-range").innertext = "720-739"
    IE.Document.GetElementById("slider-range").fireevent ("oninput")
    oTab1.Value = 720



    Please suggest me how I can provide input to range type control.
    Anything can be done using Excel
    http://vba-expert.blogspot.in/

  2. #2
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location
    I think if I gave website name that would help you to suggest me.
    This is the website
    Anything can be done using Excel
    http://vba-expert.blogspot.in/

  3. #3
    VBAX Newbie
    Joined
    Dec 2014
    Posts
    1
    Location
    Hi, I'm not that familiar with the native library that can control IE in VBA.

    Have looked at selenium-vba? You'll need to google it as I'm unable to post links on this forum yet. It's a library that allows you to automate web browsing using Firefox/Chrome/IE. Perhaps it's worth a shot.

  4. #4
    VBAX Regular raj85's Avatar
    Joined
    Feb 2010
    Location
    Mumbai
    Posts
    34
    Location
    Any one has got better solution for this ???
    As I can't installed any other software just using VBA I want to complete this.
    Anything can be done using Excel
    http://vba-expert.blogspot.in/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •