Code: Alles auswählen
Sub CSV_Download(Path$, Appendix$)
'Path: Speicherpfad; Appendix: Datumseingrenzung
'Download der csv von Thingspeak
Dim WinHttpReq As Object
Dim ostream As Object
Dim myURL As String
myURL = "https://api.thingspeak.com/channels/xxxxxxx/feeds.csv" & Appendix
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False
WinHttpReq.Send
myURL = WinHttpReq.ResponseBody
If WinHttpReq.Status = 200 Then
Set ostream = CreateObject("ADODB.Stream")
ostream.Open
ostream.Type = 1
ostream.Write WinHttpReq.ResponseBody
ostream.SaveToFile (Path)
ostream.Close
End If
End SubDanke - Stefan

