A Toad Data Point Automation Script (TAS) exports multiple datasets into EXCEL files, and then connects to all the files using a Cross Connection Query (CCQ) to merge all the data into only one dataset.
When running the TAS for the first time, it finishes with no issues, datasets are exported and merged into only one final dataset.
But, when trying to run the TAS again, it fails saying "The process can't access the Excel file XxXx because it is being used by another process. Export is cancelled", because the connections from the first execution were not released/closed, and in the second execution TDP can't export the datasets.
One must close the connections manually, and if one forgets at least once, and get the error "TDP can't access the file" error, a second issue comes up, and it's that after closing the connections manually, and trying to run for the second time after getting the error, Toad crashes and says "Toad Data Point has stopped working", one has to kill it because it becomes unusable.