Hello
I have an automated process that populates a spreadsheet and emails it. The spreadsheet contains pivot tables and the data for those tables is in the spreadsheet and gets updated by my process before the email. My process cannot update the pivot tables before sending the spreadsheet so I added a button that the recipients can click to refresh them. What I would like to do is remove this user step and just make the spreadsheet update automatically on opening. So I added this macro to do that.
This works for my copy when I open it from my folder, however when the spreadsheet is emailed and I open it, it is in protected view and when I enable editing the macro fails with an error "Object variable or with block variable not set", which I assume is because the macro ran when the spreadsheet was in protected mode.
Does anyone know a way to auto-refresh pivot tables when the user opens their emailed copy?
I'm on the 365 version of excel using windows 10.
Thanks.
Bookmarks