All,
I'm opening an excel file and grabbing some cell info using ole. The excel file isn't closing. It isn't displayed in the menu tray. The only way I know it's open is to try and open it. Then I get the locked message saying I have it open and locked.
I'm on PB2017 Build 1681 32 bit.
I tried lole_excel.application.quit() and it seems to drop the lock, but I get the do you want to save? message. Anyway to just close?
NOTE: I just saw a post that suggested using the garbagecollect ( ) function, that didn't seem to work for me either.
if lb_exists = true then
lole_excel= create oleobject
lole_excel.connecttonewobject("excel.application")
lole_excel.workbooks.open(is_file)
lole_worksheet = lole_excel.worksheets(1)
ls_check = lole_worksheet.cells(5,1).value
lole_excel.application.quit()
lole_excel.disconnectobject()
destroy lole_excel
/*process the ls_check value…*/
else
messagebox('Error', 'Cannot find file!')
end if
Hi Dennis,
To prevent the Save changes messagebox from popping, can you try adding the following before quit:
lole_excel.ActiveWorkbook.Saved = true
Cheers,
Ricardo