I have 2 basic queries on one sheet that refreshes with a button.
I am looking for a VBA code that upon refresh the sheet Unprotects, Refreshes and Protects again. I keep getting an Error 9 code and not sure why........
Thanks all!
I have 2 basic queries on one sheet that refreshes with a button.
I am looking for a VBA code that upon refresh the sheet Unprotects, Refreshes and Protects again. I keep getting an Error 9 code and not sure why........
Thanks all!
You can protect or unprotect a sheet using either the actual sheet name you see in the GUI or the code name of the sheet you have to open the Visual Basic Editor to see. In my humble opinion the later is preferred as it allows the tab name to be changed but the code will still work so based on that I think this is what you're after:
Regards,Please Login or Register to view this content.
Robert
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
I may not be doing something correct. I keep getting this error:
Make sure that your data connections are not set up for background refresh. Otherwise you may be still refreshing data when trying to reprotect the sheet.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
Also make sure the Refresh button is correctly assigned to the RefreshmyQuery macro (even just do it again to make sure).
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks