Excel 2010 Queries

kgkev

Well-known Member
Joined
Jun 24, 2008
Messages
1,245
Since updating to 2010 I am having trouble automating my sql queries.

In the past I would create the query and then use.

Code:
.QueryTable.Refresh BackgroundQuery:=False

this still works with all my old queries, but if I create a new query I have to use

Code:
.ListObject.QueryTable.Refresh BackgroundQuery:=False

This solved problem 1, Now I want to copy and paste some of the data and get a message saying...

RUN-TIME Error '1004':
Cannot complete operation: A table cannot overlap with a pivottable report, query results, a table, merged cells or an XML Mapping.

My code worked fine before, Is it possible to recreate my query the old way?

I hope you understand what I mean...

I sort of want to "Convert to Range" or ".unlist" without losing the query.
 
Last edited:

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,648
Members
414,083
Latest member
Mrsash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top