Hello to all I need to import in PB some data coming from some excel sheets. I do this: a cycle that is repeated N times with a FOR in which: I create, read and destroy excel. The problem is that excel in the task manager does not disappear, and after 10/20 loops the program runs out of memory and crashes because i have 10/20 excel. I noticed that N copies of excel disappear when I close the windows (not application) why? What am I doing wrong ? I attach code thank you
Gimmy
================================================================================
string ls_
long ll_excel_rows, iii
int li_rtn
string ls_range
oleobject lole_excel, lole_workbook, lole_worksheet
for iii = 1 to 3
lole_excel = create oleobject
li_rtn = lole_excel.ConnectToNewObject("excel.application")
if li_rtn <> 0 then
MessageBox( "Error", 'Error running MS Excel api.')
destroy lole_Excel
else
lole_excel.WorkBooks.Open("C:\a\006-20171206103943269000-03678.xls")
lole_workbook = lole_excel.application.workbooks(1)
lole_worksheet = lole_workbook.worksheets(1)
// Get the cell value
ls_ = lole_worksheet.cells(1,1).value
// Quit
lole_excel.application.quit()
lole_excel.DisconnectObject()
destroy lole_Excel
end if
next