Code to "wait" until resources released

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

Hello!

I have code that takes info from three tables (not at the
same time) and puts it into separate Excel spreadsheets.
This is done via creating a temporary table first,
exporting the data and deleting the temporary table.

Problem: The smaller temporary tables delete with no
problem. The larger one, when I try to delete it with
code, returns a "still in use" message.

Is there some kind of code I can include to wait x amount
of seconds before trying to delete the larger temp table?

Any help will be greatly appreciated!

Sandy
 
I have code that takes info from three tables (not at the
same time) and puts it into separate Excel spreadsheets.
This is done via creating a temporary table first,
exporting the data and deleting the temporary table.

Problem: The smaller temporary tables delete with no
problem. The larger one, when I try to delete it with
code, returns a "still in use" message.

Is there some kind of code I can include to wait x amount
of seconds before trying to delete the larger temp table?

You might want to post your existing code so that we can see exactly what you
are doing. Something else may be causing the problem.
 
Hello Bruce!

Thanks for your response. I am sure the problem is the
resources are still in use because if I wait for a few
seconds and then run the code to delete the table, it will
delete; thus my request for the code.

Any ideas on the "wait" code?

Sandy
 
Thanks for your response. I am sure the problem is the
resources are still in use because if I wait for a few
seconds and then run the code to delete the table, it will
delete; thus my request for the code.

Any ideas on the "wait" code?

Insert the following line where you want to allow the system time to process
before continuing:

DoEvents

If that doesn't do it, you can try inserting the same line again to give more
time, but, since I haven't seen your code, I really can't tell you if this is
the proper approach.
 
Back
Top