2012-07-26 66 views
1

我正在制作一个Excel工具使用打开XML进行某些数据处理。在此,我需要刷新我的数据透视表通过刷新支点缓存插入数据后编程。我可以通过Microsoft.Office.Interop.Excel程序集来做到这一点,但它需要时间来打开大型文件,所以我想通过使用Open XML来做到这一点。如何使用Open XML刷新Excel 2010的数据透视表高速缓存

你有什么想法,我怎么能做到这一点使用的Open XML?

请尽快回复。

使用SDK看到这里的答案谢谢

回答

1

Excel "Refresh All" with OpenXML

时直接编辑OOXML填写模板XLSX:
编辑pivotcache XML文件:XL/pivotCache/pivotCacheDefinition * .XML
添加属性值:refreshOnLoad =“1”
to node:pivotCacheDefinition

<pivotCacheDefinition 
    xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" 
    xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
    r:id="rId1" 
    refreshOnLoad="1"> 
相关问题