View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
makulski makulski is offline
external usenet poster
 
Posts: 26
Default And the answer is ... MaintainConnection

I seem to have things working now.
The MaintainConnection property of QueryTable lets my people go.

Here is the code that ultimately did the trick:


With Selection.QueryTable
.Connection = MyConnectString1 & Range("Folder") & Range("FileName")
& MyConnectString2
.CommandType = xlCmdSql
.CommandText = Array(SqlStatement)
.MaintainConnection = False
.Refresh BackgroundQuery:=False
End With