Sub WebVeriAl()
xBuKitap = ThisWorkbook.Name
SilQuery
ActiveWorkbook.Queries.Add Name:="Document", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Kaynak = Excel.Workbook(Web.Contents(""http://84.51.59.99/akakce/analiz.xlsm""), null, true)," & Chr(13) & "" & Chr(10) & " Document_Table = Kaynak{[Item=""Document"",Kind=""Table""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Değiştirilen Tür"" = Table.TransformColumnTypes(Document_Table,{{""BARCODE"", type text}, {""LİNK"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Değiştirilen Tür"""
ActiveWorkbook.Queries.Add Name:="Akakce", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Kaynak = Excel.Workbook(Web.Contents(""http://84.51.59.99/akakce/analiz.xlsm""), null, true)," & Chr(13) & "" & Chr(10) & " Akakce_Sheet = Kaynak{[Item=""Akakce"",Kind=""Sheet""]}[Data]," & Chr(13) & "" & Chr(10) & " #""Tanıtılan Üst Bilgiler"" = Table.PromoteHeaders(Akakce_Sheet, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Değiştirilen Tür"" = Table.TransformColumnTypes(#""Tanıtılan Üst Bilgiler"",{{""BARCODE"", t" & _
"ype text}, {""LİNK"", type text}, {""ÜRÜN ADI"", type any}, {""1.FİYAT"", type any}, {""2.FİYAT"", type any}, {""3.FİYAT"", type any}, {""ORTALAMA"", type any}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Değiştirilen Tür"""
Workbooks(xBuKitap).Connections.Add2 "Sorgu - Document", _
"Çalışma kitabındaki 'Document' sorgusuna yönelik bağlantı.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Document;Extended Properties=" _
, """Document""", 6, True, False
Workbooks(xBuKitap).Connections.Add2 "Sorgu - Akakce", _
"Çalışma kitabındaki 'Akakce' sorgusuna yönelik bağlantı.", _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=Akakce;Extended Properties=" _
, """Akakce""", 6, True, False
OlanSayfa
MsgBox "Bitti"
End Sub