1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=HORIZONSQL;UID=GAL;PWD=gal;DBQ=HORIZONSQL;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;" _
), Array("MTS=F;MDI=F;CSR=F;FWC=F;PFC=10;TLO=0;")), Destination:=Range("A2"))
.CommandText = requete
.Name = "Lancer la requête à partir de HORIZONSQL"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With |
Partager