You can import the whole Excel book as a new book with code given in the OC page.h file:
void import_xls(string strFile)
{
WorksheetPage wp;
int nErr = wp.OpenExcel(XL_IMPORT, strFile);
if( wp )
{
Worksheet wks = wp.Layers();
printf("Opened [%s] as an Origin workbook (%s) with Sheet '%s' active", strFile, wp.GetName(), wks.GetName());
}
else
printf("Import Excel failed, error code = %d\n", nErr);
}
You can run by compiling this and from script window:
dlgfile g:=*.xls;import_xls fname$;
The drawback is that a new book is always created and all the sheets are imported. In the next service release (SR2), we are adding support to import selected sheets into existing book.
CP