Populating a Pivot Table Cache

QB

Board Regular
Joined
Jul 5, 2004
Messages
93
Hi

I want to create a pivot table based on the results of an OLE DB Query against our JD Edwards accounting system. At present the worksheet created by the query is more than 45k lines and the workbook with the source data and pivot table is more than 54Mb.

I really want to populate the pivot table cache without having to create the worksheet with source data first. Is there a way to achieve this using VBA? I'm using Excel 2003.

More generally, is there a good book which explains Office Data Connections and OLE DB functionality clearly? I have Excel 2008 Programming - Inside Out and Bill's VBA and Macros for MS Excel but these only touch on the subject. Any suggestiuons would be geratly appreciated.

Regards

QB
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi Fazza,

Many thanks for your reply. I did search for a solution but must have used the wrong key words. I'll look at the entire thread and try to develop the code later today. Could I get back to you if I have problems?

Regards

QB
 
Upvote 0
Sure - though it is beer o'clock for me & I've just grabbed a 0.5L Weihenstephaner HefeWeißbier. :) I will not post again today.

In fact what you want to should be relatively straightforward. I don't know about the particular database, but basically query it from Excel VBA and populate a recordset. This might be covered adequately in your references, or google searches. Often the results would be pasted to a worksheet. For your situation though, and this is the trick, just set the pivotcache recordset = the one you have just created.

If you need, google for "connection strings" to find the particular connection string.

IIRC Excel 2003's help topic for recordset has example code that demonstrates the same idea. Have fun. Regards,
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

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