Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#刷新数据透视缓存或刷新表并不刷新excel数据透视表_C#_Excel_Excel Pivot - Fatal编程技术网

C#刷新数据透视缓存或刷新表并不刷新excel数据透视表

C#刷新数据透视缓存或刷新表并不刷新excel数据透视表,c#,excel,excel-pivot,C#,Excel,Excel Pivot,我有一张用C#更新的工作表。有一个使用此工作表的透视表需要刷新。我正在尝试使用VS 2015和C#刷新此透视表。我正在执行以下操作,但它似乎没有刷新透视表。我可以通过拖动我在工作表中更新的字段来确认这一点,并且数据是旧数据 Excel.PivotTable pvtTable = (Excel.PivotTable)excelSheets.PivotTables("Actives"); pvtTable.RefreshTable(); 我还试着用下面的代码使用Pivotcache,但也没用 ex

我有一张用C#更新的工作表。有一个使用此工作表的透视表需要刷新。我正在尝试使用VS 2015和C#刷新此透视表。我正在执行以下操作,但它似乎没有刷新透视表。我可以通过拖动我在工作表中更新的字段来确认这一点,并且数据是旧数据

Excel.PivotTable pvtTable = (Excel.PivotTable)excelSheets.PivotTables("Actives");
pvtTable.RefreshTable();
我还试着用下面的代码使用Pivotcache,但也没用

excelSheets.PivotTables("Actives").PivotCache.Refresh();
如果您有任何见解,我们将不胜感激。谢谢