SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Nov 2011
    Posts
    100
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Excel spreadsheet open

    Hi all,

    I have a data driven framework in QTP11.

    When creating data on the spreadsheet, I sometimes forget to close Excel,before I run my test(think we all do).

    Get error message, cool. Close Excel.

    On re-test always get a general runtime error, on the line which imports my datasheet.

    Only fix is to close QTP and restart.

    Anyone have that problem ?

  2. #2
    Advanced Member gencke's Avatar
    Join Date
    Feb 2008
    Location
    Seattle, Washington, United States
    Posts
    531
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    At the end of my tests, I call a function to close by process Excel (and a few other memory hogging apps)
    Patience is like bread I say.... I ran out of that yesterday.

  3. #3
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    Terry,

    I have seen similar issue with the Export method, but not with the Import method.

    What you can do is to create a function to close any open excel process & call this in function in your test scripts, in the beginning.
    Rajkumar

  4. #4
    Member
    Join Date
    Nov 2011
    Posts
    100
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    I will try..

    Many thanks
    Terry

  5. #5
    Advanced Member venu.adhikesevan's Avatar
    Join Date
    Jun 2010
    Posts
    517
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    Yes we do have the same problem at times but we usually go to Task manager and kill the process, but its good to check using script as suggested by Raj [img]/images/graemlins/cool.gif[/img]
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

  6. #6
    Member
    Join Date
    Aug 2011
    Location
    Bangalore, India
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    You can always close excel at the start of the script.

    However, you may still receive an error as "Datatable can not be expoorted/Imported, as the file is already in use.

    I had contacted HP and this was the solution which i received from them. Plz chk the link.

    http://automatingsap.blogspot.in/201...ortimport.html

    Regards,
    Ankesh

  7. #7
    Member
    Join Date
    Feb 2007
    Location
    London
    Posts
    391
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    Another alternative - when you import from a spreadsheet you could actually copy the spreadsheet to the temp folder and import it from there. This avoids QTP thinking the datatable is in use by someone else.

    Another benefit is that it allows you to simultanteously execute the test case on several machines, as they're not all fighting to import the same worksheet.

  8. #8
    Member
    Join Date
    Oct 2005
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    this will perfectly works, this one will close all excels and excels process




    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colProcesses = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'Excel.exe'")

    For Each objProcess in colProcesses

    objProcess.Terminate()

    Next

  9. #9
    Member
    Join Date
    Aug 2011
    Location
    Bangalore, India
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Excel spreadsheet open

    @QALeadUSA, The above solution will not work. You can not see any process running as "Excel.exe" anywhere in system/Taskbar. The issue is with the excel being imported/exported. the file gets locked, cant be deleted/modified, will be in read only mode.

    The only option available for this is the one posted by me. You could try the solution by lockdown too.

    Regards,
    Ankesh

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.33%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:09 PM.

Copyright BetaSoft Inc.