1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| ActiveWorkbook.Queries.Add Name:="sne (6)", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Source = Csv.Document(File.Contents(""\\NXPFile001.commun01.svc\VDI_CA-GIP$\Homedir_VDI_CAGIP\U54KR63\My Documents\Thierry\Production\LCL\Suivi acces passerelles SGF\2021\Fichiers Février 2021\sne.fcs102m""),[Delimiter="";"", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None])," & Chr(13) & "" & Chr(10) & " #""Type modifié"" = Table.TransformColumnTypes(Source,{{""Column1"", ty" & _
"pe text}, {""Column2"", type text}, {""Column3"", type date}, {""Column4"", type text}, {""Column5"", Int64.Type}, {""Column6"", Int64.Type}, {""Column7"", Int64.Type}, {""Column8"", Int64.Type}, {""Column9"", Int64.Type}, {""Column10"", Int64.Type}, {""Column11"", Int64.Type}, {""Column12"", type text}})," & Chr(13) & "" & Chr(10) & " #""Colonnes supprimées"" = Table.RemoveColumns(#""Type " & _
"modifié"",{""Column1"", ""Column3"", ""Column12""})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Colonnes supprimées"""
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=""sne (6)"";Extended Properties=""""" _
, Destination:=Range("$B$4")).QueryTable
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM [sne (6)]")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.ListObject.DisplayName = "sne__6"
.Refresh BackgroundQuery:=False
End With |
Partager