I'm writing a script for a database integration project using multiple upload sheets and I need to delete all contents from all worksheets and then refresh all SQL queries before running the conversion scripts that I'm calling from seperate modules (I have a tad bit of OCD when it comes to seperating my scripts) but the problem I'm running into is the script looks for certain column headers. So while the SQL query is still grabbing data, my script is looking for headers that don't exist yet. I've tried multiple wait functions and can't find one that allows the SQL statement to continue while it waits. Any help would be greatly appreciated. Thanks. Sample code below.
EDIT Solved. The only way I found the SQL statement would continue to run while waiting is the application.ontime method where the coding looked like this:
EDIT Even better, Data Range Properties for the external data import has a box that says Background Refreshing! Unchecked this and everything worked....... figures I missed it