vba 刷新 Power Pivot 窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15835109/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Refresh Power Pivot Window
提问by Vinoth
How to automatically Refresh Power Pivot Window when i open excel file , without going the Power Pivot Window
option in power pivot tab?
如何在打开 excel 文件时自动刷新 Power Pivot 窗口,而不Power Pivot Window
选择 Power Pivot 选项卡中的选项?
回答by Jacob
Vinoth,
维诺特,
It is possible to write VBA that triggers a 'refresh all' by placing the code in the Workbook module and using the Open_Event to trigger it as the workbook is opened.
可以通过将代码放在工作簿模块中并使用 Open_Event 在工作簿打开时触发它来编写触发“全部刷新”的 VBA。
If you are using 2010 then you will need to use this highly innovative technique developed by a guy called Tom Gleeson.
如果您使用的是 2010,那么您将需要使用这种由Tom Gleeson开发的高度创新技术。
If you are using 2013 then things become more straightforward as the data model is formally exposed to VBA. There are several resources out there including this.
如果您使用的是 2013,那么随着数据模型正式暴露给 VBA,事情会变得更加简单。有几个资源,包括这个。
HTH Jacob
雅各布
回答by Siraj Samsudeen
There is a Refresh All button in the PowerPivot tab that you can use for this purpose. This avoids having to open the PowerPivot window just for refresh.
PowerPivot 选项卡中有一个 Refresh All 按钮,可用于此目的。这避免了为了刷新而不得不打开 PowerPivot 窗口。
A caveat though: From what I remember, this just updates the tables which are linked from your current Excel workbook - for other types of connection, you have to go to PowerPivot window and refresh the respective tables.
但需要注意的是:据我所知,这只会更新从当前 Excel 工作簿链接的表 - 对于其他类型的连接,您必须转到 PowerPivot 窗口并刷新相应的表。
Here is some information I found on a solution for your issue in Excel 2013: http://www.vandeputte.org/2012/07/powerpivot-nuggets-part-18-automate.html
以下是我在 Excel 2013 中针对您的问题的解决方案找到的一些信息:http: //www.vandeputte.org/2012/07/powerpivot-nuggets-part-18-automate.html
回答by daddev
From Excel (not Power Pivot Manager), open:
从 Excel(不是 Power Pivot Manager),打开:
- Data
- Connections
- Connections
- 数据
- 连接
- 连接
Then, select your data source and click Properties. You should see a checkbox for refreshing the data when the file is opened.
然后,选择您的数据源并单击Properties。您应该会看到一个复选框,用于在打开文件时刷新数据。
回答by Erik Dahlen
You can also right clickon any Power Pivot chart or tables and click PivotTable Option...and than under datayou can select Refresh data when opening the file
您还可以右键单击任何 Power Pivot 图表或表格,然后单击数据透视表选项...,然后在数据下您可以选择打开文件时刷新数据
回答by Melissa S.
Excel 2013 allows for complete data model refresh through VBA. I added a button on my dashboard and assigned the following macro:
Excel 2013 允许通过 VBA 进行完整的数据模型刷新。我在仪表板上添加了一个按钮并分配了以下宏:
Sub Refresh()
子刷新()
ActiveWorkbook.Model.Refresh
ActiveWorkbook.Model.Refresh
End Sub
结束子
-Melissa
-梅丽莎
回答by Mark Robinson
This is an Excel 2010 specific issue. In Excel 2013 and later the Refresh icon on the Excel ribbon does what you'd expect it to. In Excel 2010 however linked tables, the data model and pivot tables/charts aren't refreshed by the Refresh icon.
这是 Excel 2010 特定问题。在 Excel 2013 及更高版本中,Excel 功能区上的“刷新”图标可满足您的预期。但是,在 Excel 2010 中,链接表不会通过刷新图标刷新数据模型和数据透视表/图表。
We have a solution much better and simpler than the one Tom Gleeson describes https://ukanexcel.wordpress.com/2016/11/30/refreshing-power-pivot-in-excel-2010/
我们有一个比 Tom Gleeson 描述的更好、更简单的解决方案https://ukanexcel.wordpress.com/2016/11/30/refreshing-power-pivot-in-excel-2010/