Forum Discussion
jmcpeek
11 years agoContributor
If you're continuously opening and closing Excel, how are you closing it? Are you closing the active workbook or the Excel application? If you're closing Excel itself, it could be an issue of the process not closing before you try to open it again. If that's the case, you could use a sys.waitprocess("excel") to make sure it's closed before moving on. Or, just close the workbook without closing Excel:
workbookObj.close
Then when you need to open a new workbook, you check for the existance of the process and if it's there, go straight to opening the workbook.