Hi,
I'm trying to pull a data table from an intranet webpage based on the data entered into a cell, certain time frame, but keep getting a compile error message when I try to run the VBA.
Can someone help me figure out what I'm doing wrong?
I'm trying to pull a data table from an intranet webpage based on the data entered into a cell, certain time frame, but keep getting a compile error message when I try to run the VBA.
Code:
Dim httpRequest As XMLHTTP 'XML V6.0
Dim DataObj As New MSForms.DataObject 'Forms 2.0
Dim URL$
strtDte = Sheets("Boss Wash").Range("Q35")
endDte = Sheets("Boss Wash").Range("Q37")
strtHr = Sheets("Boss Wash").Range("K35")
strtMin = Sheets("Boss Wash").Range("L35")
endHr = Sheets("Boss Wash").Range("K37")
endMin = Sheets("Boss Wash").Range("L37")
https://fclm-portal.amazon.com/reports/processPathRollup?reportFormat=HTML&warehouseId=CLT2&maxIntradayDays=1&spanType=Intraday&startDateIntraday=" & strtDte & "startHourIntraday=" & strtHr & "&startMinuteIntraday=" & strtMin & "&endDateIntraday=' & endDte & "&endHourIntraday=" & endHr & "&endMinuteIntraday=" & endMin & "&adjustPlanHours=true&_adjustPlanHours=on&hideEmptyLineItems=true&_hideEmptyLineItems=on&employmentType=AllEmployees
Set httpRequest = New XMLHTTP
httpRequest.Open "GET", URL, False
httpRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
httpRequest.send ""
' ... after the .send call finishes, you can check the server's response:
'Debug.Print httpRequest.Status
'Debug.Print httpRequest.statusText
DataObj.SetText httpRequest.responseText
DataObj.PutInClipboard
With Sheets("PPR")
.Activate
.Cells.Clear
.Cells(1, 1).Select
.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
End With
Can someone help me figure out what I'm doing wrong?