The situation is this: I’m trying to import data from an excel sheet, after this process is done I close the excel aplication like this:
xlApp.ActiveWorkbook.close SaveChanges = True
xlApp.Quit
Set xlApp = Nothing
When I try to import another file I get this error: “Cannot create automation object”.
Somehow there’s an excel process still running. So how can I know if there is any Excel process running on the server were I’m doing this. And If there is, how can I kill it?
Subject: excel process on server
first of all, the use of “SaveChanges = True” can’t possibly work; you can’t used named parameters from LotusScript, even if you remove the colon from the assignment operator first – you have to use positional arguments, which means you need to look up the syntax of the method and be sure that you’re providing the right arguments in the right order – but that you’re only providing the VALUE of the argument, not the name. So for example, if the SaveChanges argument is the only argument (or at least the first of a list of optional arguments), then you’d call the close method as either xlApp.ActiveWorkbook.close True
or
Call xlApp.ActiveWorkbook.close(True)
My guess is that this is the automation error that your code is choking on, and once you remedy this, the code will successfully continue on to execute your quit method, thus terminating the Excel process.
Subject: RE: excel process on server
Bruce, thanks for you help. I had an other problem while I was importing data from Excel. That error cut the process and didn’t reach the closing statements. Anyway, your help was very useful.Thanks.