M
Marta
I have a problem, I try the next code:
Dim SQLString As String
SQLString is a Select...
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER=SQL
Server;SERVER=MAQUETA;UID=marta;PWD=;APP=Microsoft®
Query;WSID=MARTA;DATABASE=CONFIGURACION " _
, Destination:=Range("A9"))
.CommandText = SQLString
.Name = "Consulta desde SQLConfiguracion"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = False
.Refresh
End With
If I execute step by step this code, I obtain result about the query,
but if I execute normaly, I don`t obtain data. Please Could somebody
help me?
Thanks in advance
Dim SQLString As String
SQLString is a Select...
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER=SQL
Server;SERVER=MAQUETA;UID=marta;PWD=;APP=Microsoft®
Query;WSID=MARTA;DATABASE=CONFIGURACION " _
, Destination:=Range("A9"))
.CommandText = SQLString
.Name = "Consulta desde SQLConfiguracion"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = False
.Refresh
End With
If I execute step by step this code, I obtain result about the query,
but if I execute normaly, I don`t obtain data. Please Could somebody
help me?
Thanks in advance