QueryTables error

Posted by ktm5124 on Stack Overflow See other posts from Stack Overflow or by ktm5124
Published on 2010-12-30T23:47:19Z Indexed on 2010/12/30 23:54 UTC
Read the original article Hit count: 210

Filed under:
|
|
|
|

I have the following VBA code inside an Excel macro:

With ActiveSheet.QueryTables.Add( _
    Connection:=ConnStr, _
    Destination:=ActiveSheet.Range("A1"), _
    Sql:=SqlStr)
        .Refresh
End With

And yet I am getting the error: "Run-time error '1004': Application-defined or object-defined error." The debugger points to this code as the source of error.

Assuming that my ConnStr and SqlStr are correct, why am I getting this error? I am using Excel 2007 and I am querying an Oracle database.

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about excel