B
bach
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??
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??