旋转表强制每晚刷新,这样用户可以立即操纵Pivots? [英] Pivot table force nightly refresh, so users can manipulate Pivots instantly?

查看:65
本文介绍了旋转表强制每晚刷新,这样用户可以立即操纵Pivots?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


我试图在仅包含数据透视表的xlsxm文件中编写vba宏(不缓存或数据页等)

I am attempting to write a vba macro within a xlsxm file which contains pivot tables only (no cache, or data page etc)


数据通过.mdb文件链接。  目的是在.mdb数据源刷新后,每晚打开并刷新xlsm文件中包含的枢轴。
此时用户可以在没有"打开时刷新"的情况下操纵数据透视表。目前已设置gui选项。


整点是允许用户打开.xlsm文件,然后编辑/更改数据库中的下拉菜单并立即刷新数据(因为
昨晚完成了。)

The whole point is to allow users to open the .xlsm file, and then edit/change drop downs in the pivot and have data refreshed instantly(since it was done last night ).


代码运行并刷新然后保存,但一次我打开重新打开文件,希望调整参数,我总是得到提示

Code runs and refreshes fine then save, but once i open re-open the file, hoping to adjust paramaters, i always get prompted


"数据透视表报表已保存,没有基础数据。使用刷新数据命令更新报表。"


在一个单独的测试用例中,我尝试通过gui删除"打开文件时刷新数据"选项,通过gui复制与我的代码相同的策略,但即使刷新后也是如此并保存这种方式,我仍然得到提示?

In a seperate test case, I tried removing via gui the "refresh data when opening the file" option, to replicate via gui the same strategy as my code, but even after refreshing and saving this way, i still get the prompt?


我正在寻找可能的功能吗?



感谢您的帮助

Thanks for the help


Dim Sheet As Worksheet, Pivot As PivotTable
For Each Sheet In ThisWorkbook.Worksheets
   For Each Pivot In Sheet.PivotTables
       Pivot.RefreshTable
       Pivot.Update
    Next
Next






推荐答案

在vba中,"Pivot.SaveData = True"将使用工作簿保存数据,这会阻止弹出窗口,但是
我的1mb文件跳转到20mb ....这是不是理想的结果。


这篇关于旋转表强制每晚刷新,这样用户可以立即操纵Pivots?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆