Dear members,
My queries simply do not wish to be executed when combined with a for loop or if a file is closed an saved after the query function (see the code below):
I have tried puttig the query code in different areas of the original code and using the Wait method. Nothing works. I need to take item numbers, send them as a query and receive a corresponding price, which is saved into an Excel sheet. This needs to be done for 2 up to 100 (!) item numbers. Each item number is a seperate query; I have not combined them into a single query as you never know how many item numbers you have. It can be 2 one day, 50 tomorrow.
In MATLAB I have successfully used 1000 queries in a for loop with zero issues. I don't understand why the queries (1) take so much time with VBA and (2) why they get interuppted by surrounding events. Any thoughts?
Bookmarks