I have sucessfully been using a command line to import data from an Excel worksheet(tab) and modify that data inside Foxpro V5. Now, the Excel Spreadsheet has multiple worksheets that I need to import. This is an automated program with no human intervention. I needed to get the names of the tabs in order to use the import command line with the SHEET parameter. This is what I use..."import from rat_loc+"\"+r_file xl5 sheet("Persons 25-54 (1)")". The rat_loc+"\"+r_file are varibles that I use to locate the xls file.
Whenever I use the OLE automation to get the names of the tabs like so..
oExcel = CREATEOBJECT("Excel.Application")
oWorkBook = oExcel.WorkBooks.Open(rat_loc+"\"+r_file)
oExcel.Visible = .F.
I then store the sheets to an array and close out the automation by using:
release all like o*
I then try to use my import command but I keep encountering a OLE share error. Is there something else I need to close? Is there a similar automation command that will duplicate the import?
Thanks in advance for your help.