2012-07-26 76 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"> 
相關問題