cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft Office files fails to open while Test Complete is open

Highlighted
Contributor

Microsoft Office files fails to open while Test Complete is open

Hi,



I am using Test Complete 10.10 and I access my project files from Network folder. While Test Complete is open, I noticed Microsoft Office products in Network folder fails to open. It seems the excel process is running when I checked Task Manager at that moment. It is strange that the same files open with no issues if I close Test Complete. Any work around?
5 REPLIES 5
Highlighted
Regular Contributor

RE: Microsoft Office files fails to open while Test Complete is open

It 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.
Highlighted
Valued Contributor

RE: Microsoft Office files fails to open while Test Complete is open

Can 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?

''-Praise the sun and Give Kudos.''
Highlighted
Contributor

RE: Microsoft Office files fails to open while Test Complete is open


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();


}

Highlighted
Regular Contributor

RE: Microsoft Office files fails to open while Test Complete is open

Most 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

Highlighted
Contributor

RE: Microsoft Office files fails to open while Test Complete is open

Hi 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.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors