The excel file, which previously had a fixed name, now appears with a different name every time I open the website. So I can't download the file anymore.
Here is the codes that I used before to download excel file,
Dim oXMLHTTP As Object, i As Long, vFF As Long, oResp() As Byte, vLocalFile As String, vWebFile As String
'You can also set a ref. to Microsoft XML, and Dim oXMLHTTP as MSXML2.XMLHTTP
vLocalFile = Application.ActiveWorkbook.Path & "Tuik Endeksler.xls"
vWebFile = "https://data.tuik.gov.tr/Bulten/DownloadIstatistikselTablo?p=sMXVysuuaedLY7jqIqTRPTJjtNaSSk4bjfCMOy/B20bPEhOl94J1FV9NxZxg3phH"
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", vWebFile, False 'Open socket to get the website
oXMLHTTP.Send 'send request
'Wait for request to finish
Do While oXMLHTTP.readyState <> 4
DoEvents
Loop
oResp = oXMLHTTP.responseBody 'Returns the results as a byte array
'Create local file and save results to it
vFF = FreeFile
If Dir(vLocalFile) <> "" Then Kill vLocalFile
Open vLocalFile For Binary As #vFF
Put #vFF, , oResp
Close #vFF
Is there any way to download that file without referencing a file name. I'm not good at html controls.
Here is the link about excel file
https://data.tuik.gov.tr/Kategori/GetKategori?p=Enflasyon-ve-Fiyat-106
At the rigth side of that page There is a header "?statistiksel Tablolar"
The file is at line that has name "Yeni Yurt ??i üretici Fiyat Endeksi- B?lümlerin Toplam Endeks De?i?imine Etkisi (2003=100) NACE Rev.2"
This header ("Yeni Yurt ??i üretici Fiyat Endeksi- B?lümlerin Toplam Endeks De?i?imine Etkisi (2003=100) NACE Rev.2") is constant. So maybe it can be used instead file name in macro but I have no idea how can I do that.
Thanks for your help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…