+ Reply to Thread
Results 1 to 14 of 14

Refresh external data source?

  1. #1
    Registered User
    Join Date
    11-24-2006
    Posts
    8

    Refresh external data source?

    Hello,

    I have a question regarding the refresh of external data. I would like to refresh a file on my computer (a .txt file that I create trough a logging app in C++).

    Now that's not a problem, but the point is dat the min refresh time at Excel is about 1 minute .. But I would like refresh this every second.

    Is there a way to do this? Or any other solutions?

    So I have a txt file which is updated every second, and now I would like to update that data at Excel also every second, so I can do a realtime logging ..

    thank you very much,
    Alexander

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Yes you can have XL refresh itself at any regular intervals ...
    Application.OnTime

    Read all necessary explanation from Chip

    http://www.cpearson.com/excel/ontime.htm

    HTH
    Carim

  3. #3
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    Thx Carim,

    I looked up some information, and came to this solution .. but actually, this doesn't work ..

    Please Login or Register  to view this content.
    and then my module:

    Please Login or Register  to view this content.
    I try to refresh the input data every 15 seconds?

    Thanks at advance,
    kind regards,
    Alexander

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Believe you should launch your macro at workbook open ...
    Please Login or Register  to view this content.
    HTH
    Carim

  5. #5
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    No that's not working neither

    Is it correct to past the code in 'ThisWorkbook', right?
    Or does it have to be in the 'Sheet1' part?

    kind regards,
    Alexander

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi Alexander,

    Yes you are right workbook event goes into
    ThisWorbook module ...

    Could you remove from your code the line ...
    Application.CalculateFull

    HTH
    Carim

  7. #7
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    thx Carim,

    still not working ..

    Am I doing it the right way?
    - Past the code in the VB editor
    - Compile the code
    - Close the editor and return to excel
    - Close excel, and reopen it again ..

    thank you for your time
    Alexander

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Alexander,

    Why don't you look into this previous post ...
    http://www.excelforum.com/showthread.php?t=579540

    where I sent the code for a worksheet to update itself each second ...

    HTH
    Carim

  9. #9
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    Hi Carim,

    I looked up your file, and this works for me (the refresh part) .. but it still doesn't update the data from the external file ..

    that what I have

    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    Now in the cell J2, I see the present time refreshed every second .. but still not the data that I want to be refreshed

    I tried:
    Application.CalculateFull
    Application.Calculate
    etc ..

    but nothing worked ..

    thx for your time!

  10. #10
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Alexander,

    Sorry I forgot to underline the fact that
    your macro has obviously to include your other code which extracts data from the external source ...

    HTH
    Carim

  11. #11
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    maybe a very stupid ( ) question, but what's that code ..

    as I implemented the data trough excel itself, with the properties and seperators etc.

    so what could be the code to extract the data from the external source ?

    thank you very much
    Last edited by Reeva; 11-27-2006 at 06:06 AM.

  12. #12
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Turn on the macro recorder ...
    Go through your usual key strokes ...
    VBA will "translated" your actions in code ...

    HTH
    Carim

  13. #13
    Registered User
    Join Date
    11-24-2006
    Posts
    8
    Thank you Carim,

    It's working now .. this is the code that I used:

    Please Login or Register  to view this content.
    Kind regards,
    Alexander

  14. #14
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Alexander,

    I am glad your problem is fixed ...

    Thanks for the feedback

    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

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 Friendly URLs by vBSEO 3.6.0 RC 1