Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check an Excel workbook availability
#1
Not Solved
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....

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


Attached Files Image(s)
   
Reply


Messages In This Thread
Check an Excel workbook availability - by utestqa - 05-28-2013, 07:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to check whether data exists in excel.. venkatesh9032 1 2,941 03-06-2014, 04:37 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)