Thanks DonkeyOte!!
I do not know anything about subroutines, and I tried your code in the 'ThisWorkbook' module, but it did not work. If you could explain how to do a subroutine, I will try it again.
I actually came up with the below code yesterday afternoon which looks similar to yours. This is in the 'ThisWorkbook' module and works to a point. It will protect every sheet I want and will unprotect those that need to be updated by the SQL. The problem is that even though the
comes before the 'Totals' sheet is protected, I cannot protect the 'Totals' sheet or the SQL will not fire in time...at least that is how it appears. When I run this, I get sent to the first blank line
before the popup appears asking if I want to Enable or Disable automatic refresh, which is when the database data is being imported.
Would uploading a dummy workbook help even it can't import the data from the database?
Thanks,
Andrew
Bookmarks