Yes, I just meant that the refresh event seems to require initialization, and that initialization is setup as a macro you manually run (on that page). I was simply saying that initialization should be moved to the Workbook Open event to automate it so it affects everyone all the time without having to remember anything.
Just to make sure I was right, I checked, and yes, that bit of code at the end that can just be plugged directly into the Workbook Open event and it works fine (and I checked without it, and it doesn't work, then).
So, here you go. Follow the direction the page I linked to tells you to, (you don't need to create the data connection), but use this code for the Class Module (first section):
When it tells you to create the Module, ignore that. Instead, double-click ThisWorkbook on the left pane (Project Explorer) for the workbook you're in, and paste this (replacing the empty sub that's already there):
This may need to be tweaked if you have multiple tables or if they're on sheets other than the first one. Mike will have to help with that, though, because that's a bit beyond my skill set. Well, to change it to another sheet, just change "Sheets(1)" to the number of your sheet, but I imagine you'll want it to work for all sheets, and that requires iterating through them. I can do that, but I don't know how to incorporate the results with the first section of code.
Result: if you try to refresh on Tuesday, Wednesday, or Thursday, it refreshes like normal. If you try to refresh on other days, a message box informs you "You can't refresh today." and nothing happens.
Bookmarks