>Sometimes I need to copy tables and when I try to, I get an error message saying
>the table cannot be copied. I usually close the table with "USE" and the table
>seems to be closed but VFP must grab it somewhere.
It may as well be some SQL statement somewhere, which joins to that table or selects from it - something that fills a combo's rows etc.
>When I close VFP, the copy works properly.
>How can I close the table to copy it without leaving VFP?
It may still be open under a different alias and/or in a different datasession. You may loop through an array returned by aSessions(), set datasession to each in turn, then go through all the aliases returned by aUsed() and check if one of them is your table, and close it, then go back to your datasession.
Of course, if you do this inside your app, you may be closing an alias that your code actually needs, so watch out in that case.