Seetal
13 years agoOccasional Contributor
Releasing Excel Processes
Hi,
We are connecting to an Excel File by using the following code:
However, if Test Execution fails at any point during execution and an Excel file has been opened but has not been able to close then the Excel Instance remains open.
This means that I cannot go and open the required Excel file manually to investigate the contents of the Excel file as the Excel file is locked due to it being open by TestComplete.
The only was we have found to resolve this is to Close the project and Close TestComplete and restart TestComplete and re-open the project to release the open Excel process.
Is there better way we can manage this? Or a command that can be run to release the open connections to Excel? Or any other options?
It would be great to have some ideas as it is getting very tedious to have to close and restart TestComplete each time an Excel file is left open during execution.
Thanks
We are connecting to an Excel File by using the following code:
Set objConn = CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + _
"Data Source="+ strExcelFileName + ";Extended Properties='Excel 8.0;HDR=YES'"
objConn.Open
Set ConnectDatabase = objConn
When test execution completes, successfully the Excel file is closed as required as the following statements of code are executed:
objConn.Close
Set objConn = Nothing
However, if Test Execution fails at any point during execution and an Excel file has been opened but has not been able to close then the Excel Instance remains open.
This means that I cannot go and open the required Excel file manually to investigate the contents of the Excel file as the Excel file is locked due to it being open by TestComplete.
The only was we have found to resolve this is to Close the project and Close TestComplete and restart TestComplete and re-open the project to release the open Excel process.
Is there better way we can manage this? Or a command that can be run to release the open connections to Excel? Or any other options?
It would be great to have some ideas as it is getting very tedious to have to close and restart TestComplete each time an Excel file is left open during execution.
Thanks