p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Free Code from Wrox
Go Back   p2p.wrox.com Forums > Microsoft Office > Excel VBA > Excel VBA
I forgot my password
Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 24th, 2009, 11:10 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hide Pivot Table Calculated Field

I've been having a problem hiding a calculated field in a Pivot Table in Excel 2003. I'm trying to hide a calculated field "BGT Var", and I get an error on the last line of code that states "Unable to set the Orientation property of the PivotField class. Does anyone have any idea how to hide a calculated field with VBA? Below is the code.

Code:
 
Sub Fin_Amt_Class_Select()
 
'On Error Resume Next
Dim pt As PivotTable
Dim ws As Worksheet
Set ws = Worksheets("Proj_Summ")
Set pt = ws.PivotTables("PivotTable1")
 
pt.PivotFields("BGT Var").Orientation = xlHidden
 
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 24th, 2009, 11:06 PM
Friend of Wrox
Points: 1,549, Level: 15
Points: 1,549, Level: 15 Points: 1,549, Level: 15 Points: 1,549, Level: 15
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: Sep 2005
Location: , , .
Posts: 445
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you try

pt.PivotFields("BGT Var").Visible = False

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping with calculated field in report jack123 Access 3 August 9th, 2007 07:46 AM
disable the hide button in the pivot menu paul20091968 Excel VBA 0 June 29th, 2006 09:59 AM
How to create a Calculated Field fdtoo SQL Server 2000 0 April 11th, 2006 09:34 PM
how to added a calculated field in pivot table ndenhere BOOK: Access 2003 VBA Programmer's Reference 0 May 27th, 2004 03:45 AM
Validate calculated field in sub form MG76 Access 4 March 18th, 2004 04:26 PM



All times are GMT -4. The time now is 09:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc