Moving data from a Cellset to a Worksheet

leejayd

New Member
Joined
Aug 30, 2013
Messages
9
Hi,

I'm querying an OLAP source using ADO from VBA with code similar to below :

Code:
 Set rs = New Cellset
        
 With rs
        .Open sQry, cnn
 End With

Usually I dump the Cellset into an array and then dump to the worksheet in one pass.

This doesn't work with a big query (1m rows+) due to memory problems.

I tried looping through the CellSet and writing each worksheet cell. This is impractical due the number of cells.

Does anyone if there is a better way to load a CellSet to a worksheet?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Have you tried using two queries - add a where condition in your SQL to cut the data set into two.

Something like:
WHERE UniqueID<500000
 
Upvote 0
I copied out the MDX query and pasted it into a Power Pivot query - it worked ! 1.5 million rows returned in less than 2 minutes.

This was a very big query with many member predicates - I was surprised Power Pivot didn't crash.
 
Upvote 0

Forum statistics

Threads
1,215,742
Messages
6,126,611
Members
449,321
Latest member
syzer

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
Back
Top