I'm new to posting on forum as well as new to VBA so please forgive me.
I have some code that protects a sheet so that nothing can be changed on the sheet but also allows grouping/ungrouping functionality to work (i.e. enable outlining). Also on this same sheet, I have a SAP Business Warehouse query embedded onto the sheet (i.e. Excel Add-In). I am able to refresh my query if the sheet is protected but no password is used when creating the protection. However, when I use a password with my sheet protection, I get the error message "Function is not available on a protected worksheet" when I am trying to refresh the query. (fyi to refresh this query, the user must click an icon on the SAB Business Warehouse add-in toolbar).
Below is the code I am using to set the protection and the password.
I have tried without VB code to turn sheet protection on with and without a password and I am getting the same effect (i.e. query will refresh when not using a password but will not refresh when using a password).
I prefer not to have VB code that the user has to use to refresh the query (i.e. turn off protection, run query, turn on protection). I guess if that is the only option, then I will need to do this. Any ideas as to how this can be done? Thks!
Bookmarks