Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check an Excel workbook availability
#1
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
#2
Reply
#3
if you are using qtp then you can use "MSGBOX", else you can create a wshell object and use Popup method.
Thanks,
SUpputuri
Reply
#4
Thanks,

I am using qtp.

I'd like my script to notify a user to close the excel file.

Is there any way to pop a message on a remote computer in the same network with my script?

Regards,
François
Reply
#5
Yes Francois it is possible. There are 2 ways

1) Using WMI and send message
2) Create Wshell object pointing to the remote box where the file is opened and then use popup method.

Though I never used these (I'm not had this kind of situation) I am sure this will work .... let me know if you need any further info
Thanks,
SUpputuri
Reply
#6
Reply
#7
Any idea?


Attached Files Image(s)
   
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)