I have a spreadsheet that accesses an external datasource using MSQUERY. I have written a macro that will REFRESH the data from the datasource. As you know this can take up to 20 seconds to complete.
The spreadsheet is Worksheet Protected. Part of the macro is to Unprotect the worksheet before the Refresh then to Protect it again once the Refresh is complete.
The problem I have is that the code to Protect the worksheet is running before the Refresh completes. This causes an error because the Refresh is now writing to a Protected sheet.
Can I delay the execution of the Protect Worksheet macro command until the Refresh is complete?
thx
Bill King
The spreadsheet is Worksheet Protected. Part of the macro is to Unprotect the worksheet before the Refresh then to Protect it again once the Refresh is complete.
The problem I have is that the code to Protect the worksheet is running before the Refresh completes. This causes an error because the Refresh is now writing to a Protected sheet.
Can I delay the execution of the Protect Worksheet macro command until the Refresh is complete?
thx
Bill King