SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Sep 2008
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DataTable.ExportSheet doing nothing?

    Hello,
    I've searched through the forum and found many posts about general errors and such on using DataTable.ExportSheet but I have a situation where I am getting no error, nothing in the log, it's simply not saving the changes.
    The first time I ran this code (a few days ago) it worked, but it hasn't worked on any subsequent runs. I'm pretty sure I've made no further changes to the script.

    Here's the relevant code:

    <font class="small">Code:</font><hr /><pre>
    strInputFile = "Q:\MASEnv\MAS TestData\MDE Merchant Adjustments.xls"
    DataTable.ImportSheet strInputFile , 1 , "Action1"


    'setting up loops, writing data out from datasheet to AUT


    DataTable.Value ("DateKeyed", dtLocalSheet) = SixDigitDate(Date)


    'looping thru, navigating hierarchies in AUT until done
    'then fall through to


    DataTable.ExportSheet strInputFile ,1
    </pre><hr />

    I've breakpointed at the "DataTable.Value ("DateKeyed", dtLocalSheet) = SixDigitDate(Date)" line and it is putting the desired values in the desired column.

    I thought maybe that since it's the last executable line and this server is sometimes slow to work with it was a timing thing. So, I put in a "Wait(10)" after the exportsheet but that made no difference.

    Any Ideas?

    Thanks,
    Ken

  2. #2
    Member
    Join Date
    Sep 2008
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DataTable.ExportSheet doing nothing?

    OK, a little more...

    So, I changed the exportsheet line to:
    "DataTable.ExportSheet strInputFile ,"Sheet1" "

    and now I get a fail step in the log that says:
    The DataTable.ExportSheet operation failed. The Sheet1 sheet does not exist.
    Line (234): "DataTable.ExportSheet strInputFile ,"Sheet1"".

    The sheet clearly exists.

    Before I was using the sheet sequence number and it just didn't do anything or give me any feedback.

    Any ideas now?

    Thanks,
    Ken

  3. #3
    Member
    Join Date
    Sep 2008
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DataTable.ExportSheet doing nothing?

    Ok, although I feel like I'm talking to myself, for those who will run into this in the future.

    I couldn't get exportsheet to work as documented. I used Export, which gives you a workbook with a sheet for each open data table in your test. In my case I went from having my data on "Sheet1" of my workbook before the test run to have a workbook with 1st sheet = "Global" and my data on 2nd sheet = "Action1".
    So I used the deletesheet method to get rid of the "global" sheet. So my data, with my updated column is back to being the 1st sheet. Now my "check test" is using the same code to import as it was before but I have all the data I need.

    DataTable.DeleteSheet "Global"
    DataTable.Export (strInputFile)

    -Ken

  4. #4
    Senior Member
    Join Date
    Sep 2006
    Location
    CA, USA
    Posts
    425
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DataTable.ExportSheet doing nothing?

    You can try:

    DataTable.ExportSheet "strInputFile", "Action1"

    It did nothing because your Runtime Table does not have a data sheet called "Sheet1".

    When you use "DataTable.ExportSheet "strInputFile", 1, it indeed exported your Globel sheet previously I believe.

    Also, by using Export, it exports the whole runtime table, so you don't have to delete Global sheet unless you don't wan't it to be added to your input file. As a consequence, when you import, you have to know 1 is the Global.

 

 

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.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:39 PM.

Copyright BetaSoft Inc.