VBA_Selecting Filter on Site
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: VBA_Selecting Filter on Site
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA_Selecting Filter on Site

    Hello guys,




    • i am working on project where i need vba code to click on "Add Filter", code here looks like -


    <div class="select-filter-field no-filters" ng-class="{'no-filters' : currentOptions.length === 0}" ng-click="addFilter()">
    <i class="fa fa-fw fa-filter"></i>
    Add filter
    </div>

    event is also there which shows like -

    function(e) {
    return void 0 !== T && T.event.triggered !== e.type ? T.event.dispatch.apply(t, arguments) : void 0
    }



    • after clicking on said "Add filter" small list opens up and i require to click on say 4th item. code is -


    <li class="filter-type-option" ng-repeat="field in ::filterFields" ng-click="setFilterField(filter, field)" ng-hide="filterFieldApplied(field.field)">
    <i class="fa fa-fw fa-calendar" ng-class="field.icon"></i>
    Date
    </li>

    again event is like -

    function(e) {
    return void 0 !== T && T.event.triggered !== e.type ? T.event.dispatch.apply(t, arguments) : void 0
    }

    Thanks in advance........

  2. #2
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,703
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Hello

    Can you post the page address where the control is or is it a restricted site?
    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Hi,

    Actually its restricted so not able to share it. can share url but that would be of no help.....

  4. #4
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,703
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Can you post the actual image of the code inspect window for the add filter control, as exemplified below?

    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


  5. #5
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Hi Please see below,
    Hope this helps...


  6. #6
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,703
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    I cannot see it. You have to upload it to a hosting site and paste a link here, it will display as either a text link or the picture itself, as I did. I am using Imgur to share my images.
    Alternatively, you could email it to me.
    Considering I cannot test with the actual site, this will increase our chances of success.
    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


  7. #7
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Hey,

    sorry for that, it is showing when i see my page, not sure here what happened, copying link again, i hope you will able to see this time,

    https://cdn1.imggmi.com/uploads/2019...e5aa9-full.png

  8. #8
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,703
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    I can see it now. Please test the code below and report the results:

    Code:
    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    
    Sub test()
    Dim IE As Object, htmlDoc As Object, sURL$, col, cs, cn$
    Set IE = CreateObject("internetexplorer.application")
    sURL = "http://www.physiofirst.org.uk/find-physio/search-physio.html"   ' your URL here
    cn = "form-control mod-text-display"     ' my testing
    'cn = "select-filter-field no-filters"   ' use this one, appears to be your class
    With IE
        .navigate (sURL)
        .Visible = True
    End With
    WaitIE IE, 2000
    Set htmlDoc = IE.Document
    Set col = htmlDoc.getElementsByClassName(cn)
    MsgBox col.Length & " elements.", 64
    For Each cs In col
        MsgBox cs.Type, 64, "Type"
    Next
    WaitIE IE, 1000
    End Sub
    
    
    Sub WaitIE(IE As Object, Optional time As Long = 250)
    Do
        Sleep time
    Loop Until IE.readyState = 4 Or Not IE.Busy
    End Sub
    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


  9. #9
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    Hey buddy,

    thanks for this. i tested the same and getting Run-time error '438' at line - "MsgBox cs.Type, 64, "Type"

  10. #10
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,703
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA_Selecting Filter on Site

    How about the first message box? What does it say?
    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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