.refresh issue RRS feed

  • Question

  • Could someone help me out why the .Refresh line results in an error.

    For i = 2 To Sheets(1).Cells(1, 1).End(xlToRight).Column

    ticker = Sheets(1).Cells(1, i)

    qurl = "" & ticker & "/key-statistics?p=" & ticker & ""


    With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, Destination:=Sheets(2).Range("A1"))
        .BackgroundQuery = True
        .Refresh BackgroundQuery:=False
    End With

    Cells(2, i).Select
    CutCopyMode = False

    Next i

    End Sub

    Appreciate any support/indication. Thanks!

    Tuesday, June 13, 2017 7:12 PM

All replies

  • Hi Bentol888,

    I try to test the code on my side.

    I did not get any error on .Refresh line.

    if possible for you then you can try to post the sample file with dummy data in it.

    it is possible that my data are different and not able to reproduce the issue.

    I will again try to make a test on side and try to find the solution.

    other thing I notice that you are getting an error but you did not posted the description of an error.

    it is better if you post the error description. it can be helpful to solve the issue.

    I suggest you to debug the code and check the value of variable 'ticker'. check that it contains the value and it is not empty.

    if it is empty then it can generate the error.

    so make sure that you are passing the proper data.

    let me know about your testing results. so that I can try to provide you further suggestions if needed.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, June 14, 2017 2:59 AM