Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Can't set pivot table object variable

Hello All,

I have a simple workbook with two worksheets that I named in the IDE as
wksImportedData and wksPivot, which hold an external data QueryTable and a
Pivot Table respectively.

I wrote a procedure to make it easy for my client to "reset" the pivot table
to its default configuration, in case they get carried away dragging fields
all over creation (and who doesn't, with pivot tables?). The problem is that
my object variable doesn't seem to get assigned to the pivot table like it
should. Here is the code:

dim pvtFinancials as Excel.PivotTable
set pvtFinancials = wksPivot.PivotTables("pvtAcctFinancials")

When I use pvtFinancials in the code, however, I get a 1004 error. As a
sanity check, I typed the following into the Immediate Window:

?wksPivot.PivotTables.Count

and got a 1. Encouraged, I typed:

?wksPivot.PivotTables(1).Name

and got a 1004 error. Does anyone have any ideas as to what might be going
on?

All help and advice are greatly appreciated,
- jeff
Reply
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
Entering Variable in a Pivot Table flyer27 Excel Discussion (Misc queries) 0 March 13th 07 03:05 PM
variable last cell in pivot table macro Alan P Excel Programming 3 December 8th 05 04:09 PM
Pivot Table variable range La Durande Excel Programming 1 October 18th 04 08:42 PM
Im so close. Need variable range for the pivot table Loren[_2_] Excel Programming 1 October 5th 04 10:53 PM
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM


All times are GMT +1. The time now is 10:01 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"