Hi,
I am trying to create an Excel addin that retrieves query statements from a
report generator and loads them as querytables in the active worksheet. The
problem I am having is when I try to execute the QueryTables.Add method.
I have declared oXL as an object and instantiated it with
Set oXL = Application
When I execute this code...
With oXL.ActiveSheet.QueryTables.Add(connection:=gConnect,
Destination:=Range("A5"), sql:=sql$)
..Refresh
End With
I get an error message that says "Method '~' of Object '~' failed."
The same syntax works fine if I try this from VBA, but not within my VB6
Addin. Any ideas as to what I am doing wrong?
Thanks
Bookmarks