0

VS 2008 を使用して、asp.net/C#/.net 3.5 で Microsoft.Office.Interopt.Excel アプリを開発しています。

ピボット テーブルを更新しようとしていますが、次のステートメントがコンパイルされません。

wkSheet.PivotTables("PivotTable1").PivotCache.Refresh;

次の2つのエラーが発生し続けます。誰か助けてください!

1.Only assignment, call, increment, decrement, and new object expressions can be used as a statement    

2.'object' does not contain a definition for 'PivotCache' and no extension method 'PivotCache' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
4

1 に答える 1

0

これらのメッセージはどちらも明確ではありません。次のようなものを試してください。

PivotTable pvtTable = (PivotTable)wkSheet.PivotTables("PivotTable1");
pvtTable.RefreshTable();
于 2012-04-23T07:49:04.427 に答える