Reading data from Excel into Forms 4.5

From: <dperez_at_juno_NOSPAM_.com>
Date: 1998/01/10
Message-ID: <RtDt.1065$aS.164579_at_news.internetMCI.com>#1/1


I need to read data from an Excel spreadsheet into an Oracle 4.5 form. So far, I can open the file and get the data. Everything is fine. BUT, on the real Excel workbook there will be multiple spreadsheets. I need to make sure I get to the RIGHT spreadsheet. Below is the code I'm using to open the workbook.

declaree

  obj_excel 	OLE2.OBJ_TYPE;;
  obj_workbooks OLE2.OBJ_TYPE;;
  arg_sheets	OLE2.LIST_TYPE;;

beginn
  obj_excel := OLE2.CREATE_OBJ('Excel.Application');;   arg_sheets := OLE2.CREATE_ARGLIST;;
  OLE2.ADD_ARG(arg_sheets, :control.filespec);;   obj_workbooks := OLE2.INVOKE_OBJ(obj_excel, 'Workbooks');   OLE2.INVOKE(obj_workbooks, 'Open', arg_sheets);;   :global.obj_excel := to_char(obj_excel);; end;

The code works fine, and I can open the workbook and read the stuff fine, so I'm not real interested in changing it unless there's something significantly better, but...
Can someone provide the code that will enable me to 1. Determine which spreadsheet of the workbook I'm currently looking at 2. Switch to a different spreadsheet if necessary. The users have promised

     they'll name the sheets consistently.............. Received on Sat Jan 10 1998 - 00:00:00 CET

Original text of this message