DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub Test()
Dim strURL As String, strParameter As String
Columns("A:B") = ""
strParameter = Format(Date - 1, "yyyymmdd")
strURL = "https://marketdata.theocc.com/stock-loan-eligible-securities?fileName=" & strParameter
With ActiveSheet.QueryTables.Add(Connection:="URL;" & strURL, Destination:=Range("A1"))
.BackgroundQuery = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
If ActiveWorkbook.Connections.Count > 0 Then
ActiveWorkbook.Connections(ActiveWorkbook.Connections.Count).Delete
End If
Range("A1").CurrentRegion.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, other:=True, OtherChar:=",", FieldInfo:=Array(1, 1)
Columns("A:B").AutoFit
End Sub
Sub Test2()
Dim strURL As String, strParameter As String
strURL = "https://sample-videos.com/csv/Sample-Spreadsheet-100-rows.csv"
With ActiveSheet.QueryTables.Add(Connection:="URL;" & strURL, Destination:=Range("A1"))
.BackgroundQuery = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
If ActiveWorkbook.Connections.Count > 0 Then
ActiveWorkbook.Connections(ActiveWorkbook.Connections.Count).Delete
End If
Range("A1").CurrentRegion.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, other:=True, OtherChar:=","
Columns("A:J").AutoFit
End Sub