+ Reply to Thread
Results 1 to 6 of 6

macro clash

  1. #1
    Registered User
    Join Date
    03-11-2005
    Posts
    87

    macro clash

    Hi all,

    I have this problem on which I am kind of stuck. I have an on-time macro (say "A") that runs every five seconds and basically download a data series, item by item. In that five seconds period in between runs, another macros ("B") may need to run using the last item downloaded. However what happens is that "B" doesnt run as the macro "A" is still engaged until the next download and therefore stops "B" from running.

    Ideally there must be a way the turn the "on time" into a series of one-shot on-times (i.e. a series of single download macros basically ).

    Any suggestion appreciated!!

    Best
    BC

  2. #2
    Tom Ogilvy
    Guest

    RE: macro clash

    Ontime already works as you desire - if it takes the macro more than the
    allotted time to finish, then you will have the problem you describe. Just
    like two objects can't occupy the same space, two macros can't run at the
    same time. You will have to change your interval to allow both macros to
    run.

    --
    Regards,
    Tom Ogilvy


    "bondcrash" wrote:

    >
    > Hi all,
    >
    > I have this problem on which I am kind of stuck. I have an on-time
    > macro (say "A") that runs every five seconds and basically download a
    > data series, item by item. In that five seconds period in between runs,
    > another macros ("B") may need to run using the last item downloaded.
    > However what happens is that "B" doesnt run as the macro "A" is still
    > engaged until the next download and therefore stops "B" from running.
    >
    > Ideally there must be a way the turn the "on time" into a series of
    > one-shot on-times (i.e. a series of single download macros basically ).
    >
    >
    > Any suggestion appreciated!!
    >
    > Best
    > BC
    >
    >
    > --
    > bondcrash
    > ------------------------------------------------------------------------
    > bondcrash's Profile: http://www.excelforum.com/member.php...o&userid=20997
    > View this thread: http://www.excelforum.com/showthread...hreadid=537175
    >
    >


  3. #3
    Bob Phillips
    Guest

    Re: macro clash

    I would suggest changing the re-launch code of A and B to re-launch each
    other. It might mean that A doesn't run every 5 seconds, but it will give
    better control.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "bondcrash" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi all,
    >
    > I have this problem on which I am kind of stuck. I have an on-time
    > macro (say "A") that runs every five seconds and basically download a
    > data series, item by item. In that five seconds period in between runs,
    > another macros ("B") may need to run using the last item downloaded.
    > However what happens is that "B" doesnt run as the macro "A" is still
    > engaged until the next download and therefore stops "B" from running.
    >
    > Ideally there must be a way the turn the "on time" into a series of
    > one-shot on-times (i.e. a series of single download macros basically ).
    >
    >
    > Any suggestion appreciated!!
    >
    > Best
    > BC
    >
    >
    > --
    > bondcrash
    > ------------------------------------------------------------------------
    > bondcrash's Profile:

    http://www.excelforum.com/member.php...o&userid=20997
    > View this thread: http://www.excelforum.com/showthread...hreadid=537175
    >




  4. #4
    Registered User
    Join Date
    03-11-2005
    Posts
    87
    Tom,

    the macro "A" takes a fraction of a second to run - the "B" can be several of them but no more than one at a time and those take a fraction of a second to run as well. I think 5 secs is more than enough to allow "B" to run. The problem, as I see it, is that the on-time macro "A" is on all the time, even in between the five seconds event since it waits for the next run, and I think "B" is not allowed to run untill "A" is done but being an on-time means never... (or until i stop it).

    I may run some individual macro's each to do the task and say print a time on the sheet and whenever there are more than five secs re-run it etc but the problem is in that case I need to have the time function continuously going and I need an outside source for that because otherwise the time is updated only at recalculation. Basically I am a bit stuck.

    Thanks for the suggestion Bob but basically I have several of them and have no way to know which one/if any of the "B" will get triggered by the latest download of "A" (I am basically back-testing a series and see if it generates a signal).

    Cheers guys
    BC

  5. #5
    Tom Ogilvy
    Guest

    Re: macro clash

    No, that isn't how Ontime works at all. It isn't on all the time. If fires
    the macro and ends. If excel is busy, it won't fire the macro as it is not
    preemptive. Depending on how you configure it, it can be allowed to try
    again. See the help for details.

    See Chip Pearson's page on ontime for some examples.

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

    --
    Regards,
    Tom Ogilvy


    "bondcrash" wrote:

    >
    > Tom,
    >
    > the macro "A" takes a fraction of a second to run - the "B" can be
    > several of them but no more than one at a time and those take a
    > fraction of a second to run as well. I think 5 secs is more than enough
    > to allow "B" to run. The problem, as I see it, is that the on-time macro
    > "A" is on all the time, even in between the five seconds event since it
    > waits for the next run, and I think "B" is not allowed to run untill
    > "A" is done but being an on-time means never... (or until i stop it).
    >
    > I may run some individual macro's each to do the task and say print a
    > time on the sheet and whenever there are more than five secs re-run it
    > etc but the problem is in that case I need to have the time function
    > continuously going and I need an outside source for that because
    > otherwise the time is updated only at recalculation. Basically I am a
    > bit stuck.
    >
    > Thanks for the suggestion Bob but basically I have several of them and
    > have no way to know which one/if any of the "B" will get triggered by
    > the latest download of "A" (I am basically back-testing a series and
    > see if it generates a signal).
    >
    > Cheers guys
    > BC
    >
    >
    > --
    > bondcrash
    > ------------------------------------------------------------------------
    > bondcrash's Profile: http://www.excelforum.com/member.php...o&userid=20997
    > View this thread: http://www.excelforum.com/showthread...hreadid=537175
    >
    >


  6. #6
    Registered User
    Join Date
    03-11-2005
    Posts
    87
    cheers Tom

    BC

+ 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