hi arnsto ,

Well well well!  Hope you're familiar with vba ...

I've got this issue and I've solved it this way enjoy it :


Public Function Report0() As Integer
Report0 = 1
On Error GoTo errorhandler
    Dim db As String
    Dim sql As String
    Dim pt as PivotTable
    db = "The database full path"

    sql = "SELECT * FROM Report1"


    With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
        .Connection = "ODBC;DSN=MS Access Database;DBQ=" & db &
";DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
        .CommandType = xlCmdSql
        .CommandText = Array(sql)
        .CreatePivotTable TableDestination:=ActiveSheet.Cells(15, 1),
TableName:="ReportTD1", DefaultVersion:=xlPivotTableVersion10
        .CreatePivotTable TableDestination:=ActiveSheet.Cells(50, 1),
TableName:="ReportTD2", DefaultVersion:=xlPivotTableVersion10
        .CreatePivotTable TableDestination:=ActiveSheet.Cells(100, 1),
TableName:="ReportTD3", DefaultVersion:=xlPivotTableVersion10
        .CreatePivotTable TableDestination:=ActiveSheet.Cells(150, 1),
TableName:="ReportTD4", DefaultVersion:=xlPivotTableVersion10
    End With

    Set pt = app.ActiveSheet.PivotTables("ReportTD1")
    bla bla bla

    Set pt = app.ActiveSheet.PivotTables("ReportTD2")
    bla bla bla

   bla bla bla
    Exit Function
errorhandler:
 MsgBox Err.Description
End Function









On Nov 12, 1:19 pm, arnsto <arn...@gmail.com> wrote:
> Having a h u g e workbook with about 20 ws, and about 50 pivots.
> ( Several Pivots on same worksheet.)
>
> The datasource is placed in one sheet only, and reg. updated (exported
> from Acces 2003.) replacing al the data.
>
> Problem:
> - The file steals memory, and is slow to work with..
> - It seems that a lot of pivots are not sharing the same cashe. (I
> have learned that it is best to base new pivots on a "mother pivot".
> Is that correct?
> - I do not want to rebuild all the pivots in the file..
>
> Want:
> a) vba routine to ensure that all pivots are based on the same pivot
> cache
> b) select one "mother pivot" cashe to be used by all pivots table
>
> Am I far out ? Suggestions?
>
> arnsto

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe

Reply via email to