Greetings All!
I have a large workbook with a data connection that feeds into a pivot table on a separate sheet. When the data connection updates, the pivot table wasn't. So I looked around and found the magical RefreshAll vba. However, all of the sheets are locked so users can't muck up the pivot table. So I tried adding in the code to unprotect the worksheet with the pivot table, then having the refresh run, and then finally reprotecting the sheet upon the workbook opening.
The problem is that it says my password is not correct when I try to run the macro...but excel takes the password just fine if I unprotect it manually.
I have the code for the refresh itself inside a module:
and the vba to run it upon opening in the This Workbook area:Please Login or Register to view this content.
I also have set the data connections to not update unless I refresh them.Please Login or Register to view this content.
Since the file is large - nearly 6 Mb, could that be a problem? Even before the macro issues, the data connection itself was taking around 20 seconds to complete.
I am also working on them from home, so I am using a mac here but a pc there...could that be a problem?
The data connection itself is to an internal website that requires logging in...but the error comes from the password unprotect line of code.
Any ideas would be greatly appreciated!
Bookmarks