Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default QueryTables Add

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
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
Error when trying to use QueryTables.Add Mindblower Excel Programming 0 August 31st 04 01:44 PM
QueryTables Error GJones Excel Programming 0 April 27th 04 02:35 PM
With ActiveSheet.QueryTables.Add [email protected] Excel Programming 4 January 6th 04 04:58 PM
QueryTables Interrupt if URL is Down Steve Hieb Excel Programming 0 November 17th 03 10:07 PM


All times are GMT +1. The time now is 01:37 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"