Results 1 to 4 of 4
  1. #1

    Save Runtime DataTable to Default.xls

    I would like to know how to write / update to DataTable during runtime and saving Default.xls. Currently I way I can think of is exporting DataTable to a different file, but this is not ideal.

  2. #2

    Re: Save Runtime DataTable to Default.xls

    [Assuming, you did not attach external Excel as your DataTable source]
    If you write:

    DataTable.Value(ParameterID [, SheetID])=NewValue

    new value will go into Default.xls and
    will be saved automatically when TC finishes.
    Next time - it will appear in this Default.xls as you've set it.
    No additional import\export is required.

    (This is from QTP Help --> DataTable Object, Value Property)


  3. #3

    Re: Save Runtime DataTable to Default.xls

    Thanks for the reply. I did use your example but my Default.xls does not take the new values. Instead when I view results I can see the update when I view runtime DataTable.

  4. #4

    Re: Save Runtime DataTable to Default.xls

    OK. Let's try to Export data into Default.xls
    [not into different file,
    because you do not need that as you've said...]

    As you know: Export Function in QTP works as 'SaveAs' and requires absolute full path to Excel file.
    We do not need to hardcode path for our Default.xls.
    It should be universal, compatible with any TC.
    OK. We can BuiltIn QTP's Environment variable ["TestDir"]
    to code this path.


    Datatable.Export(Environment.value("TestDir") &"\Default.xls" )




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 07:39 PM.

Copyright BetaSoft Inc.