Refresh Pivot Table: Do you want to replace the destination cells

P

pgchop

I refresh the pivot table in many different excel files, using in VBA either

ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
or
ActiveSheet.PivotTables("PivotTable1").RefreshTable

What I dont get is why "some times" the program stop and request human
intervention with the question

"Do you want to replace the destination cells in Sheet1 ?

Any idea on how to force the answer to "yes" !?!... and go on...

pg
 
N

nickysquawkes

I think you need to turn the display alerts off using the following:

Application.DisplayAlerts = False

Nick
 
G

GB

Additionally, I think that DisplayAlerts = false will choose the default
setting of the window that normally would pop up. I have used this before,
but thought there was some caveat about trying to get the thing to do what I
wanted it to do, because the default answer was No or something like that....
Hmmm.. I think nicky is right though, at least that option must be
implemented.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top