LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default creating multiple pivots fails

Hi.

I wrote an add-in that retrieves numerous parameters, extracts data from the
database, and returns a PivotTable, with none of the fields set... just the
outline of it.

This works fine, for creation of a single pivot table. However, I put it in
a loop to retrieve information for numerous projects, and it's failing at
this line:

pvC.CreatePivotTable TableDestination:="", TableName:=pvName,
DefaultVersion:=xlPivotTableVersion10

pvC is my PivotCache, pvName is the name of the pivot table.

The loop creates a new workbook, so each pivot table is in it's own Excel
workbook.

The error that I get is:

Application-defined or object-defined error

but if I hit Debug, and then hit the continue button (without changing
anything), it works. However, on the next run of the loop, I get the same
error, with no chance to Debug/Continue, and it stops.

However, if I put a Breakpoint into the code at this point, and manually
press the continue button for each run through the loop, it doesn't fail.

So, it appears that something is conflicting in the memory. I'd tried
putting in a DoEvents line, but it has no effect.

Can someone suggest something else to try? Thanks.

mark



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to edit multiple pivots at one time? MichelleO Excel Programming 5 August 24th 09 02:19 PM
microsoft multiple pivots kate Excel Discussion (Misc queries) 2 June 23rd 06 12:56 AM
Creating Multiple GIFs from Multiple Range selections -- I need a volunteer to test my code to see why it fails Father Guido[_5_] Excel Programming 0 November 19th 05 08:52 AM
I would like to build macro's to do pivots or part of pivots Todd F.[_2_] Excel Programming 2 July 29th 05 03:59 PM
Pivots using other pivots and dynamic query problem lc Excel Programming 0 November 7th 03 03:02 PM


All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"