• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How can I parse phone numbers using string manipulation from a webpage?

Status
Not open for further replies.
@Marc L,
I have already gone through your code several times. My skin runs temperature to see your this bit of code. Every time I go through your code to make it easier, I find it more difficult to understand. I would like to understand your existing code so, It will be very helpful for me If you give me any link where you have used similar type of method for somebody so that i can read that as well. Thanks in advance.
 
@Marc L,
Thanks for the links. You have always been a great help to me. It's amazing that you have solutions to every problem in vba. Btw, I got something interesting following a link where I noticed that Microsoft is shortly bringing in a new feature to handle errors which is [Try/Except/Finally].
 
A variation to find out the beginning of JSon data structure
(see codeline #10 S = …) :​
Code:
Sub Demo2a()
    Dim R&, S$, oC As Object, oM As Object
    ActiveSheet.UsedRange.Clear
    [D2].Value = "  Downloading …"
             R = 1
With New XMLHTTP60
    .Open "GET", "https://oresapp.asicanada.net/ores.imis.services/api/member/?callback=angular.callbacks._0", False
    .send
     S = Mid$(.responseText, InStr(.responseText, "("))
End With
    [A1:G1].Value = [{"Id","FullName","Phone","Fax","Email","WebSite","LocationId"}]
With New ScriptControl
                   .Language = "JScript"
    For Each oC In .Eval(S)
            R = R + 1
            Cells(R, 1).Resize(, 6).Font.Bold = True
            Cells(R, 1).Resize(, 6).Value = Array(CallByName(oC, "Id", VbGet), oC.Company, oC.WorkPhone, oC.Fax, oC.EmailAddress, oC.Website)
        For Each oM In oC.Members
            R = R + 1
            Cells(R, 1).Resize(, 7).Value = Array(CallByName(oM, "Id", VbGet), oM.FullName, oM.Phone, oM.Fax, oM.Email, _
                                                  CallByName(oM, "WebSite", VbGet), oM.LocationId)
        Next
    Next
End With
    ActiveSheet.UsedRange.Columns.AutoFit
End Sub
You may Like it !
 
Status
Not open for further replies.
Back
Top