LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default QueryTables.Add Connection Parameter

I am trying to connect to an existing Excel 97 spreadsheet.

I have found the following connection strings from www.connectionstrings.com/. I have tried both
versions (seperately) and I get the same error message 1004: application-defined or object-defined
error.

I have been able to use this method to connect to an external Oracle database using ODBC.

Is there something wrong with my coonection string? BTW ThisSheet is declared as Excel.Worksheet
and definitely exists.


ThisSheet.QueryTables.add Connection:="Driver={Microsoft Excel Driver
(*.xls)};DriverId=790;Dbq=D:\MonthlyStatsMaster.xl s;DefaultDir=D:\;", _
' Destination:=ThisSheet.Range("A1"), Sql:="Select * from [Hierarchy$]"

ThisSheet.QueryTables.add Connection:="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\MonthlyStatsMaster.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""", _
Destination:=ThisSheet.Range("A1"), Sql:="Select * from [Hierarchy$]"




Nirmal Singh
 
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
Data Connection Parameter Issue Scytok Excel Worksheet Functions 0 September 15th 09 04:48 PM
always recheck data connection library for latest connection strin FurmanGG Excel Discussion (Misc queries) 0 September 14th 07 04:48 PM
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
help with ActiveSheet.QueryTables.Add Connection: uriel78 Excel Programming 1 March 6th 05 04:08 PM
QueryTables Add Marta[_3_] Excel Programming 0 January 19th 05 05:32 PM


All times are GMT +1. The time now is 12:18 AM.

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

About Us

"It's about Microsoft Excel"