Forum Discussion
5 Replies
Sort By
- hlalumiereRegular ContributorMost likely there is no error. What happens is that Excel NEVER opens multiple instances when opening a file. All the files are opened in the same process, with extra taskbar icons but a single window. So if you first instanciate in code an Excel.Application object, and fail to quit it properly (no more EXCEL.EXE in running processes), the next file you open opens up within the same (invisible) instance. Just make sure you properly dispose of the object.
Set objXl = CreateObject("Excel.Application")
...
For Each wb In objXl.WorkBooks
wb.save
wb.Close
Next
objXl.Quit
Set objXl = Nothing - hlalumiereRegular ContributorIt sounds like you are instanciating an Excel object in your script, and not disposing of it properly. The process stays opened. Your files are actually opening, you just can't see the main window.
- Ryan_MoranValued ContributorCan you explain further on "fails to open"? Does it give you a message about the file being in use? Are you using data-driven testing?
- lnd_amaralContributor
If there is a running process, certainly an error message appears.
Try using something like this.
//excel...word..powerpoint..
if (Sys.Process("EXCEL").Exists){
Sys.Process("EXCEL").Terminate();
} - Vivek72ContributorHi All
I am not using Data-Driven Testing nor my scripts are hooked to any excel files. The problem is not just confined to excel files but Microsoft word too. To be sure I checked Task Manager if any Office related .exe files are running already before trying to open Microsoft files, so I can say no process was running already. But yes, if I close the default dialog that is displayed usually before any office application opens, I can see the .exe process related to that file in the task manager still running. Sys.Process("EXCEL").Terminate() or any such sort of commands are of no use because this issue is not created while script execution or after the script execution, it just happens if I open test complete and access project file from my Network location and then try to open any Office products from the same network location.
Thanks for all suggestions.
Related Content
- 11 years agoMorgan
- 11 years agokpinnisetti
- 5 years agoADHDude
Recent Discussions
- 2 days agovladd1