Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49948

Compile Error:Syntax Error

$
0
0
hi there,

i am trying to make a webquery on a multiple page website to extract. I got some codings from mr Leith ross and tried to incorporate them with other declaration but I am getting a Syntax error. anyone please? I need help. thanks...
Code:

Sub getthem()

    Dim StartDate  As Variant
    Dim EndDate    As Variant
 
  Set ChangeDateWS = Worksheets("Sheet1")
  Set gather = Worksheets("Sheet4")
 
  StartDate = Format(ChangeDateWS.Range("B5").Value, "yyyy-mm-dd")
  EndDate = Format(ChangeDateWS.Range("B6").Value, "yyyy-mm-dd")
 
  With gather.QueryTables.Add(Connection:= _
      "URL;https://website.site.com/folder/processed_view.jsp?action=find&sdate=" & StartDate & "&edate=" & EndDate &start=0", _
        Destination:=Range("a1"))
 
      .BackgroundQuery = True
      .TablesOnlyFromHTML = True
      .Refresh BackgroundQuery:=False
      .SaveData = True
  End With
End Sub


Viewing all articles
Browse latest Browse all 49948

Trending Articles