Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table pulling wrong value RestlessAde Excel Discussion (Misc queries) 2 February 16th 11 07:17 PM
Password box to remain open after wrong input Twanny Excel Discussion (Misc queries) 4 September 1st 05 09:29 PM
What is wrong with this =AVERAGE(IF formula? fbarbie Excel Worksheet Functions 5 March 16th 05 02:42 PM
What's wrong with this vb? DaveMoore Excel Worksheet Functions 2 February 24th 05 01:29 PM
IF function displays wrong amount JAnderson Excel Worksheet Functions 4 November 6th 04 06:41 PM


All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"