QueryTables error
- by ktm5124
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.