Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Connection Parameter Issue | Excel Worksheet Functions | |||
always recheck data connection library for latest connection strin | Excel Discussion (Misc queries) | |||
How to choose if I use a parameter or not in a parameter query | Excel Discussion (Misc queries) | |||
help with ActiveSheet.QueryTables.Add Connection: | Excel Programming | |||
QueryTables Add | Excel Programming |