Results 1 to 8 of 8
  1. #1

    Update Excel simultaneously

    I am using xls to get output data.The file is kept in a shared location and workbook is given shared option.When I run scripts in multiple machines some data has been overwriten due to simultaneous use of xls.
    Could you pls suggest some solution for this.
    Using QTP 9.1

  2. #2

    Re: Update Excel simultaneously

    It's depending of the type use that you are doing in your scripts.

    If you are using the file only to read information you should open the file as a read only, or make a copy for each instance of qtp, this can be used while your running the test and once the test is completed you can erase them.

    Otherwise if you are reading and updating data in the file, you need to validate what you want to do, due It seems that you are updating the same cells without any control.


  3. #3

    Re: Update Excel simultaneously

    Not really a QTP question, just need to establish a methodology. Give each machine a tab and combine the results later. Make a checkout system where you establish a counter in a cell that the script reads and increments to reserve a row(still a slight possibility of dupes). Give each machine a row equal to a multiple of 1s,2s,3s etc.

  4. #4

    Re: Update Excel simultaneously

    I am importing the sheet at the start of the script and update the last row.During same time other mc would try to do same.During exporting the latest mc data will over write 1st mc data.

    using new sheet for each machine is fine but i am using citrix where i can run multiple sessions.So mc id is same for all sessions.

  5. #5

    Re: Update Excel simultaneously

    I wouldn't import and export the entire sheet but rather create an excel Object so that you would be performing an actual save through the app rather than essentially a file system overwrite.

    Still you'd need to establish a method. Reserve rows based on test case names if machine id won't work maybe?

  6. #6

    Re: Update Excel simultaneously

    I tried did create excel object for excel that is in local drive.It worked fine.But the same code did not work on qc.

    I Tried following object:

    Set con = CreateObject(”ADODB.Connection”)
    con.Open “Provider=Microsoft.Jet.OLEDB.4.0;” & _
    “Data Source=\\QC location\TestData.xls;”
    con.Execute _
    (”select * from MasterSheet”)

    Could you pls provide a method to read a row of excel that is in qc rather than importing.

    I can download xl to local mc and then do the rest,but for updation i need it on qc.
    As NoUse4 suggested I can reserve some rows and update.

  7. #7

    Re: Update Excel simultaneously

    Updation? What sort of word is that? [img]/images/graemlins/wink.gif[/img]

    I'm not aware of a way to read from excel in place on QC. Just several ways to extract. Since you mentioned sharing I presumed that you had it stored on a server/local machine rather than in QC. Don't know if it's possible to truly share a file for writing in QC. Would think even if you did hook it up in real-time, QC would throw a version of its "locked by another user" message.

  8. #8

    Re: Update Excel simultaneously

    I mentioned updation because on runtime i would modify existing rows or append based on flag set.

    Due to firewall i could not use shared location for all users/mc to access.
    Thanks for your suggetions.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:54 PM.

Copyright BetaSoft Inc.