Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:26:17+00:00 2026-05-30T20:26:17+00:00

I have an Exel 2007 PivotTable using classic layout that has 2 row fields.

  • 0

I have an Exel 2007 PivotTable using classic layout that has 2 row fields. For a given data PivotCell, I want to loop through and identify the corresponding row field names and item values for that cell. My code works fine if I am on a sub-total or grand total line (0 or 1 items associated with the cell). But it fails if I try to work with a cell associated with 2 items – “Run-time error ‘1004’: Application-defined or object-defined error”.

The following line succeeds when i=1, but fails when i=2:

cellSpec(1, i) = pvtCell.RowItems(i).LabelRange.PivotCell.PivotField.SourceName

When I set a watch expression to pvtCell, I see that:

pvtCell.RowItems(2).LabelRange.PivotCell=<Application-defined or object-defined error>

Yet pvtCell.RowItems(2).Name has the expected valid value.

Anyone know a reliable method to get the name of the RowItem’s field?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:26:18+00:00Added an answer on May 30, 2026 at 8:26 pm

    I finally found the answer on a dedicated Excel forum 🙂 http://www.mrexcel.com/forum/showthread.php?p=1638552#post1638552

    The code is now simpler, and it actually works!

    cellSpec(1, i) = pvtCell.RowItems(i).Parent.SourceName
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a bunch of WCF REST services hosted on Azure that access a SQL
I have a CUDA project. It consists of several .cpp files that contain my
Have finally got a responsive site working (of a fashion). What I want to
Have some code: using (var ctx = new testDataContext()) { var options = new
Have a look at one of my websites: moskah.com The problem is that it
Have some dates in my local Oracle 11g database that are in this format:
have an an array String classname[]={'a','b','c','d'}; ArrayAdapter<CharSequence> adapterClasses = new ArrayAdapter<CharSequence>( getApplicationContext(), R.layout.spinner_item_class, R.id.spinnerclasstxt,
Have any one tried to activate fancybox thumbnail gallery using a button or an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.