19 בנוב׳ 2023, 13:18

@גבאי
אולי יעזור לך
קוד מוכן להוריד את הקובץ לטבלה מקומית, מצו"ב הקוד, שים לב להחליף את הטוקן

Function importListAllInformation()

strtoken = "0770000000:1234"
Set xhrRequest = CreateObject("Msxml2.ServerXMLHTTP.6.0")
sURL = "https://www.call2all.co.il/ym/api/DownloadFile?token=" & strtoken & "&path=ivr/EnterID/ListAllInformation.ini"

xhrRequest.Open "GET", sURL, False
xhrRequest.Send
       
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write xhrRequest.ResponseBody
DoEvents

filePath = CurrentProject.Path & "\ListAllInformation.txt"
If Len(Dir(filePath)) Then Kill filePath
oStream.SaveToFile filePath
oStream.Close

filePath = CurrentProject.Path & "\ListAllInformation.txt"
DoCmd.SetWarnings False

TableIsExists = Not IsNull(DLookup("Name", "MSysObjects", "type in(1,6) and Name='ListAllInformation'"))
If TableIsExists Then DoCmd.Rename "LAI_" & Now, acTable, "ListAllInformation"
DoCmd.TransferText acImportDelim, "", "ListAllInformation", filePath, True, , 65001
Kill filePath
MsgBox "בוצע בהצלחה", vbInformation, "בוצע"

End Function

תיצור כפתור בטופס כל שהוא שיקרא לפוקנציה, דוגמא:

Private Sub Import_Click()
importListAllInformation
End Sub