存储对PivotCell的引用 [英] Storing reference to PivotCell

查看:108
本文介绍了存储对PivotCell的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在excel加载项中,我需要保留一个数据透视单元列表.但是,似乎PivotCell对象变成无效"对象.刷新数据透视表后. (所有方法都会引发以下异常).

In an excel add-in I need to keep a list of pivotcells. However, it seems that PivotCell objects become "invalid" after a pivottable has been refreshed. (All methods throw exceptions like the one below).

作为替代方案,我尝试将单元格地址存储到单元格,但是当用户例如在轴上扩展节点时,这些地址可能会变得不正确.

As an alterative I tried to store the cell-address to the cells, but these can become incorrect when the user for example expands a node on an axis.

保留对数据透视单元格引用的最佳解决方案是什么?

What would be the best solution for keeping references to pivotcells? 

 

示例异常:

System.Runtime.InteropServices.COMException(0x800A01A8):来自HRESULT的异常:0x800A01A8

System.Runtime.InteropServices.COMException (0x800A01A8): Exception from HRESULT: 0x800A01A8

  在System.RuntimeType.ForwardCallToInvokeMember处(字符串memberName,BindingFlags标志,对象目标,Int32 [] aWrapperTypes,MessageData& msgData)

   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

  在Microsoft.Office.Interop.Excel.PivotCell.get_Range()

   at Microsoft.Office.Interop.Excel.PivotCell.get_Range()

  在

   at

推荐答案

你好,史蒂文,
 
感谢您的提问.我们正在对此问题进行研究.我们可能需要一些时间才能回复您.

Hello Steven,
 
Thanks for your question. We’re doing research on this issue. It might take some time before we get back to you.

以下是您可能会感兴趣的资源: 如何获取关键单元源范围? . 今天过得愉快.

Here is a resource which might interest you: How to get pivot cell source range?. Have a nice day.

最诚挚的问候,
赵贝茜-MSFT
论坛中的MSDN订阅者支持
如果您对我们的支持有任何反馈,请联系 msdnmg@microsoft.com .

Best regards,
Bessie Zhao - MSFT
MSDN Subscriber Support in Forum
If you have any feedback of our support, please contact msdnmg@microsoft.com.


这篇关于存储对PivotCell的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆