#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
bondcrash
------------------------------------------------------------------------
bondcrash's Profile: http://www.excelforum.com/member.php...o&userid=20997
View this thread: http://www.excelforum.com/showthread...hreadid=537175

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote
in message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro clash


Tom,

the macro "A" takes a fraction of a second to run - the "B" can b
several of them but no more than one at a time and those take
fraction of a second to run as well. I think 5 secs is more than enoug
to allow "B" to run. The problem, as I see it, is that the on-time macr
"A" is on all the time, even in between the five seconds event since i
waits for the next run, and I think "B" is not allowed to run until
"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
time on the sheet and whenever there are more than five secs re-run i
etc but the problem is in that case I need to have the time functio
continuously going and I need an outside source for that becaus
otherwise the time is updated only at recalculation. Basically I am
bit stuck.

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

Cheers guys
B

--
bondcras
-----------------------------------------------------------------------
bondcrash's Profile: http://www.excelforum.com/member.php...fo&userid=2099
View this thread: http://www.excelforum.com/showthread.php?threadid=53717

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro clash


cheers Tom

B

--
bondcras
-----------------------------------------------------------------------
bondcrash's Profile: http://www.excelforum.com/member.php...fo&userid=2099
View this thread: http://www.excelforum.com/showthread.php?threadid=53717

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Userform / Visual Themes Clash jonzo Excel Programming 0 March 13th 06 11:29 AM
clash between different versions of excel? inenewbl Excel Discussion (Misc queries) 0 July 26th 05 03:30 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"