Hi all,
This is my first post. Please let me know if I'm doing things the wrong way or if you need any other informations.
I am using QTP 11 and excel 2007.
How is it possible to indentify if an excel workbook is already open elsewhere? I have some tests that use the same workbook and they are running in parallel. If a test open a workbook, I need the other one to wait for it to be available before using it.
Any help or solution insight would be greatly appreciated.
Regards,
François
This is what I have right now....
This is my first post. Please let me know if I'm doing things the wrong way or if you need any other informations.
I am using QTP 11 and excel 2007.
How is it possible to indentify if an excel workbook is already open elsewhere? I have some tests that use the same workbook and they are running in parallel. If a test open a workbook, I need the other one to wait for it to be available before using it.
Any help or solution insight would be greatly appreciated.
Regards,
François
This is what I have right now....
Code:
public Sub verification_ouverture_DT(Workbook_path, Workbook, DT_sheet)
dim iteration,
iteration = 0
Do
On Error Resume Next
Datatable. ???workbookavailability???? Workbook_path, Work
book, DT_sheet
If err.number = 0 Then
Exit Do
end if
wait(10)
iteration = iteration + 1
If iteration = 30 Then
Reporter.ReportEvent micFail, "Workbook not available", "Workbook not available" & err.description
exittest ()
End If
loop until iteration = 30
End Sub
verification_ouverture_DT "C:\fichier.xls", 1 , 1