ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Script help (https://www.excelbanter.com/excel-programming/278508-vbulletin-script-help.html)

Quanchi

VB Script help
 
Hello all,

I need some help. I have an Excel XP spreadsheet with a couple of
pivot tables. I have the tables set not to automatically refresh
because they connect to an Oracle datbase via a ODBC connection and
some users use the file while on the road.

I want to add a command button to the spreadsheet that the user can
click to refresh all pivot tables in the spreadsheet. Yes, i know that
there are tool bars for this, but all users dont have the needed tool
bars enabled and I wanted to make it really easy for everybody by
adding the button in the spreadsheet.

So, can anybody give me an example of the VB code for the click event
to refresh all pivot tables in my Excel file?

Thanks in advance,

Quanchi



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Quanchi[_2_]

VB Script help
 
Can Anybody help me on this?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Kristen Lindholm

VB Script help
 
See if this works for you:

Dim pc As Excel.PivotCache

For Each pc In ActiveWorkbook.PivotCaches
pc.Refresh
Next pc

Quanchi[_3_]

VB Script help
 
Works great...thanks for your help.

Quanchi



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com