Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Pivot Table Pivot Item Visible - Why so difficult

A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Pivot Table Pivot Item Visible - Why so difficult

Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:
A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Pivot Table Pivot Item Visible - Why so difficult

On Jan 3, 9:52*am, Debra Dalgleish wrote:
Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
* * *.AutoSort xlManual, .SourceName
* * * * .PivotItems("Aniseed Syrup").Visible = True
* * *.AutoSort xlAscending, .SourceName
End With

headly wrote:
A recorded macro does this code


* * With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
* * * * .PivotItems("Aniseed Syrup").Visible = True
* * End With


Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class


Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?


--
Debra Dalgleish
Contextureshttp://www.contextures.com/tiptech.html




Just a followup Qn on Pivot Table.

I want to refresh the Pivot table automaticall and I use the following
code.
D7 is the first cell in that Table.

Range("D7").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh

It works fine most of the time, but show some error sometimes.
Any idea why? or Is there any better way of achieving the same?

Thanks a lot
Joe
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Pivot Table Pivot Item Visible - Why so difficult

You don't need to select a cell in the pivot table, so you could delete
that line of code.
What error message do you get?

Joe wrote:
On Jan 3, 9:52 am, Debra Dalgleish wrote:

Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With

headly wrote:

A recorded macro does this code


With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With


Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class


Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?


--
Debra Dalgleish
Contextureshttp://www.contextures.com/tiptech.html





Just a followup Qn on Pivot Table.

I want to refresh the Pivot table automaticall and I use the following
code.
D7 is the first cell in that Table.

Range("D7").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh

It works fine most of the time, but show some error sometimes.
Any idea why? or Is there any better way of achieving the same?

Thanks a lot
Joe



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Thanks, works, but why?

That's great but why did it work? I'm writing a course on VBA and my students
will likely ask what is the sort command and why is it necessary? TIA

"Debra Dalgleish" wrote:

Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:
A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Thanks, works, but why?

The sort setting is the one you can manually change in the Field
Settings, when you click the Advanced button.
If it's manually or programmatically set to Manual, you shouldn't get
the error when making pivot items visible.
If it's set to Ascending or Descending, you'll get the error when you
programmatically try to make an item visible.
I don't know the reason why.

headly wrote:
That's great but why did it work? I'm writing a course on VBA and my students
will likely ask what is the sort command and why is it necessary? TIA

"Debra Dalgleish" wrote:


Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:

A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Thanks, works, but why?

Thank you so much; I hope you don't mind if I give you credit in my
courseware! I will also highly recommend your books on pivot stuff, you are
far away too expert.
Happy holidays, you rock!

"Debra Dalgleish" wrote:

The sort setting is the one you can manually change in the Field
Settings, when you click the Advanced button.
If it's manually or programmatically set to Manual, you shouldn't get
the error when making pivot items visible.
If it's set to Ascending or Descending, you'll get the error when you
programmatically try to make an item visible.
I don't know the reason why.

headly wrote:
That's great but why did it work? I'm writing a course on VBA and my students
will likely ask what is the sort command and why is it necessary? TIA

"Debra Dalgleish" wrote:


Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:

A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Thanks, works, but why?

You may want to share Debra's site with your students, too.



headly wrote:

Thank you so much; I hope you don't mind if I give you credit in my
courseware! I will also highly recommend your books on pivot stuff, you are
far away too expert.
Happy holidays, you rock!

"Debra Dalgleish" wrote:

The sort setting is the one you can manually change in the Field
Settings, when you click the Advanced button.
If it's manually or programmatically set to Manual, you shouldn't get
the error when making pivot items visible.
If it's set to Ascending or Descending, you'll get the error when you
programmatically try to make an item visible.
I don't know the reason why.

headly wrote:
That's great but why did it work? I'm writing a course on VBA and my students
will likely ask what is the sort command and why is it necessary? TIA

"Debra Dalgleish" wrote:


Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:

A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Thanks, works, but why?

You're welcome! Thanks for letting me know that it helped.

headly wrote:
Thank you so much; I hope you don't mind if I give you credit in my
courseware! I will also highly recommend your books on pivot stuff, you are
far away too expert.
Happy holidays, you rock!

"Debra Dalgleish" wrote:


The sort setting is the one you can manually change in the Field
Settings, when you click the Advanced button.
If it's manually or programmatically set to Manual, you shouldn't get
the error when making pivot items visible.
If it's set to Ascending or Descending, you'll get the error when you
programmatically try to make an item visible.
I don't know the reason why.

headly wrote:

That's great but why did it work? I'm writing a course on VBA and my students
will likely ask what is the sort command and why is it necessary? TIA

"Debra Dalgleish" wrote:



Add code to set the sort to manual, and that should prevent the error:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.AutoSort xlManual, .SourceName
.PivotItems("Aniseed Syrup").Visible = True
.AutoSort xlAscending, .SourceName
End With


headly wrote:


A recorded macro does this code

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Product Name")
.PivotItems("Aniseed Syrup").Visible = True
End With

Yet when i try the comand in the immediate window i get run time error 1004
unable to set the visible property of the pivotitem class

Am i missing a reference? As i type pivot code, i don't get any code hints.
is this a late binding problem?


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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
Pivot Table Calculated Item Dominic Excel Discussion (Misc queries) 1 April 26th 06 11:50 PM
Pivot Table Calculated Item SamBayer1957 Excel Discussion (Misc queries) 1 August 11th 05 10:27 PM
pivot table data item Dominique Feteau[_2_] Excel Programming 4 December 18th 04 05:01 PM
Visible Property Pivot Item anonymous Excel Programming 0 September 23rd 04 01:41 PM
Difficult Pivot Table Technical Question Heath[_2_] Excel Programming 0 December 11th 03 05:18 PM


All times are GMT +1. The time now is 01:42 AM.

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"