Excel Launch Application not working on Control Tower, but works on Recorder

I have a macro I’ve built in recorder that launches Excel via the Launch Application action. I do this to move the results of some dynamic calculations to static cells that I can then extract with the Excel actions.

This action works perfectly when I run it from the macro recorder. However, when I import it to the Control Tower and attempt to run it from there, Excel is never launched. I’ve tried with both escaped and unescaped backslash. Per troubleshooting guidance, I’ve been using the following command path:

C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE

I’ve stripped it down so that there are no command line actions after the application path, but that hasn’t helped.

Here’s the error string I’m getting from the next action, a Window Action looking for the application by window name. Any and all assistance appreciated:

org.webharvest.exception.PluginException: [urn:uuid:287E51B023AB18851A1533241436895125] robotics-flow executePlugin exception: [nodeId=http://127.0.0.1:1] com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=SwitchWindowAction.ftl,id=2,name=Optional[SwitchWindowAction],parent=-1,arguments=ActionArguments[modeType=[BY_TITLE],delay=[0],timeoutMs=[0],xsi:type=[recorder:SwitchWindowAction, recorder:SwitchWindowAction],active=[true],actionDetails=[(book)],title=[(?i).\Qbook\E.],useRegexpTitle=[true]]]
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:116)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:187)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:97)
at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:168)
at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:139)
at com.workfusion.service.machine.BotRecordExecutionService.processSubmissionWithAllocationLogger(BotRecordExecutionService.java:118)
at com.workfusion.service.machine.BotRecordExecutionService.lambda$processRecord$0(BotRecordExecutionService.java:97)
at com.workfusion.utils.thread.NamedThreadTemplate.executeWithNamedThread(NamedThreadTemplate.java:10)
at com.workfusion.service.machine.BotRecordExecutionService.processRecord(BotRecordExecutionService.java:97)
at com.workfusion.service.machine.thread.RecordProcessThread.run(RecordProcessThread.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.webharvest.exception.PluginException: com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=SwitchWindowAction.ftl,id=2,name=Optional[SwitchWindowAction],parent=-1,arguments=ActionArguments[modeType=[BY_TITLE],delay=[0],timeoutMs=[0],xsi:type=[recorder:SwitchWindowAction, recorder:SwitchWindowAction],active=[true],actionDetails=[(book)],title=[(?i).\Qbook\E.],useRegexpTitle=[true]]]
at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.executePlugin(RecorderPlugin.java:109)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27)
at org.webharvest.runtime.processors.WebHarvestPlugin.executeBody(WebHarvestPlugin.java:246)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:105)
… 16 more
Caused by: com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=SwitchWindowAction.ftl,id=2,name=Optional[SwitchWindowAction],parent=-1,arguments=ActionArguments[modeType=[BY_TITLE],delay=[0],timeoutMs=[0],xsi:type=[recorder:SwitchWindowAction, recorder:SwitchWindowAction],active=[true],actionDetails=[(book)],title=[(?i).\Qbook\E.],useRegexpTitle=[true]]]
at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:30)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:17)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlaybackProcess.start(RecorderPlaybackProcess.java:79)
at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.play(RecorderPlugin.java:123)
at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.executePlugin(RecorderPlugin.java:104)
… 21 more
Caused by: org.openqa.selenium.NoSuchWindowException: Window ‘[REGEXPTITLE:(?i).\Qbook\E.]’ is not found
Build info: version: ‘9.0.0.3’, revision: ‘1610cb545e’, time: ‘2018-05-24T16:45:36.185Z’
System info: host: ‘P10TBAUTOMATE01’, ip: ‘10.10.1.110’, os.name: ‘Windows NT (unknown)’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: unknown
Command duration or timeout: 0 milliseconds
at sun.reflect.GeneratedConstructorAccessor760.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:41)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:656)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.window(RemoteWebDriver.java:1026)
at com.workfusion.rpa.helpers.RPA.switchToExistingWindow(RPA.java:204)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at Script3_genScript_15.run(Script3_genScript_15.groovy:7)
at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:90)
at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:65)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:35)
at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:46)
… 27 more
Caused by: org.openqa.selenium.NoSuchWindowException: Window ‘[REGEXPTITLE:(?i).\Qbook\E.]’ is not found
Build info: version: ‘9.0.0.3’, revision: ‘1610cb545e’, time: ‘2018-05-24T16:45:36.185Z’
System info: host: ‘P10TBAUTOMATE01’, ip: ‘10.10.1.110’, os.name: ‘Windows NT (unknown)’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: unknown
Build info: version: ‘9.0.0.3’, revision: ‘1610cb545e’, time: ‘2018-05-24T16:45:36.185Z’
System info: host: ‘P10TBAUTOMATE01’, ip: ‘10.10.1.110’, os.name: ‘Windows NT (unknown)’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: unknown
at com.workfusion.autoit.driver.WindowsFinder.window(WindowsFinder.java:56)
at com.workfusion.autoit.driver.WindowManager.window(WindowManager.java:157)
at com.workfusion.universal.driver.UniversalTargetLocator.window(UniversalTargetLocator.java:42)
at org.openqa.selenium.remote.server.handler.SwitchToWindow.call(SwitchToWindow.java:60)
at org.openqa.selenium.remote.server.handler.SwitchToWindow.call(SwitchToWindow.java:26)
at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(WebDriverHandler.java:41)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:133)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:203)
at org.openqa.selenium.remote.server.InMemorySession.execute(InMemorySession.java:98)
at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:231)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
… 3 more

Hi @sbeauchem , could you share your recording here?

let me see if i can recreate it–i was on a tight schedule so i overwrote the launch application step with a Win+R to excel.exe as a workaround.

Ok…so I had to go back to experimenting with this because Win+R is not working unattended on 2.0.1 (another thread on this forum), and I finally found an approach that worked. I stuffed the following into a String variable, and called the variable from the launch action:

“C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE” C:\pathttofile\datecalc.xlsx

Don’t ask me why this particular approach worked, but it does.

1 Like

@sbeauchem Thank a lot for the update.
This is a bit weird that it works when read from a variable but not when the path is explicitly specified. We will test it.