我正在用ASP.NET/C#/.NET3.5开发一个Microsoft.Office.Interopt.Excel应用程序,使用的是VS2008。
我正在尝试刷新一个数据透视表,但是下面的语句不能编译。
wkSheet.PivotTables("PivotTable1").PivotCache.Refresh;我不断得到以下两个错误。谁来帮帮忙!
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?)发布于 2012-04-23 15:49:04
这两条信息都很清楚,可以尝试这样的方式:
PivotTable pvtTable = (PivotTable)wkSheet.PivotTables("PivotTable1");
pvtTable.RefreshTable();https://stackoverflow.com/questions/10276712
复制相似问题