Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing excel after the import command is done and there is an error

Status
Not open for further replies.

sangred

Programmer
Apr 4, 2002
11
0
0
US
I'm just wondering if anyone has ever used the
import from &mfile TYPE XL8 SHEET "sheet" command and used the If found() function after it to determine if the sheet "sheet" exists. I did this and it seems to work so I issue a return to stop the rest of the code from running. If I execute the same code again though it say's file in use.

I think the import command is leaving the file open and not closing it because it encounters an error with the sheet not exisiting in the xls file. Is there any way to force foxpro to close the excel file it left open?

Thanks,
Ryan
 
It sounds like you are creating a new table from the inport. If that is correct, the you need to close the table that the import command created.

use in tablename

Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top