+ Reply to Thread
Results 1 to 3 of 3

Problem with hidden field in pivot table

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    23

    Problem with hidden field in pivot table

    Hi,

    I am reading a pivot table from xls file into my VBA code and peforming some calculations based upon the same.

    In the Pivot table, I have one of the fields which is not added to the pivot report. This field is required by me in the calculations. When I refer to this field in the VBA code, I am unable to get the value from the same and get an error : Application or Object Undefined

    When I manually add the field to the pivot report in the xls file and run the same VBA code, it works fine.

    Is there a way to programatically control the adding of this required field to the pivot report temporarily as I do not have the control of the xls file and can't make any permanent changes to the file.

    Thanks in advance.

    Shantanu Kulkarni

  2. #2
    Registered User
    Join Date
    08-16-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Problem with hidden field in pivot table

    Hi All,

    Don't worry. I found a solution. Setting a correct orientation property to the pivot field in VBA code resolved my issue.

    Refer to the code below

    Please Login or Register  to view this content.
    Last edited by Cutter; 09-24-2012 at 07:17 PM. Reason: Added code tags

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Problem with hidden field in pivot table

    @ shantanuk

    Welcome to the forum.

    Please notice that [CODE] tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.

    Also, based on your last post it seems that you solved your issue on your own but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1