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:="snpp (3)", 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 Juin 2021\snpp.fcs106m""),[Delimiter="";"", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None])," & Chr(13) & "" & Chr(10) & " #""Type modifié"" = Table.TransformColumnTypes(Source,{{""Column1"", type" & _
" 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) & "in" & Chr(13) & "" & Chr(10) & " #""Type modifié"""
ActiveWorkbook.Worksheets.Add
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=""snpp (3)"";Extended Properties=""""" _
, Destination:=Range("$A$1")).QueryTable
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM [snpp (3)]")
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.ListObject.DisplayName = "snpp__3"
.Refresh BackgroundQuery:=False
End With |
Partager