View Single Post
  #1   Report Post  
bach
 
Posts: n/a
Default What is wrong with this


Private Sub Workbook_Activate()

Dim sqlstring As String
Dim connstring As String


Sheets("Sheet2").Select
Range("A1").Select

sqlstring = "SELECT statemet"

connstring = "ODBC;DSN=Sales;UID=;PWD=;DATABASE=Sales"

With ActiveSheet.QueryTables.Add(Connection:=connstring ,
Destination:=Range("Sheet2!$A$1"), Sql:=sqlstring)
.RefreshPeriod = 0
End With

End Sub

User name and password has been removed. I throught
Application.ScreenUpdating = False should work but it does not any
idears??


--
bach
------------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=402924