PC Review


Reply
Thread Tools Rate Thread

Application.Wait information request

 
 
Michelle
Guest
Posts: n/a
 
      15th Feb 2008
Hello all!

I have a question about the Wait function in VBA. I currently am using it
to pause my macro before continuing through a do/ while loop. In this loop
I'm checking a cell value. In this cell is an add-in function from
Bloomberg. When I first enter the function the end result doesn't appear
right away. Instead a "requesting data" value shows in the cell first. It
takes a while before the actual answer appears. In the do/ while loop I keep
checking the value over and over again because I can't do the next step until
the true value shows. My question is if I have the application wait will it
also stop the function from being able to pull the data from Bloomberg by
pausing the connection with it as well? I only ask because I can't seem to
get a value past the initial "requesting data" output, and I can if I simply
run the function in a cell without using the macro. (I'm really hoping this
all makes sense.) I have looked all over these discussion groups, and can't
quite come up with an answer. When I looked at the msdn site I found this
answer, "However, background processes such as printing and recalculation
continue," but am uncertain if this pertains to functions that are add in's
from another software.

I originally had the do/ while loop continually running without a pause, but
I couldn't seem to get past the "requesting data" doing that either. If I
just continually run the loop will Excel still be also continually accessing
Bloomberg or will it pause that?

Any help would be greatly appreciated. If you have any questions regarding
this don't hesitate to post. I think this might be a convoluted question.
Thank you in advance.

--
Cheers,
Michelle
"Anyone who says he can see through women is missing a lot." Groucho Marx
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      15th Feb 2008
You could try this. It allows everything else to run while its macro is
paused.

Public Function TwoSecDly()
s = Timer + 2
Do While Timer < s
DoEvents
Loop
End Function

Paste this in the top of your module and call it by simply typing TwoSecDly
as a line in your code, no quote marks. You can set it for as many seconds
as you need or even tenths of seconds. Just change the 2 to the desired
number. To be consistent, you might want to change to macro name accordingly.


"Michelle" wrote:

> Hello all!
>
> I have a question about the Wait function in VBA. I currently am using it
> to pause my macro before continuing through a do/ while loop. In this loop
> I'm checking a cell value. In this cell is an add-in function from
> Bloomberg. When I first enter the function the end result doesn't appear
> right away. Instead a "requesting data" value shows in the cell first. It
> takes a while before the actual answer appears. In the do/ while loop I keep
> checking the value over and over again because I can't do the next step until
> the true value shows. My question is if I have the application wait will it
> also stop the function from being able to pull the data from Bloomberg by
> pausing the connection with it as well? I only ask because I can't seem to
> get a value past the initial "requesting data" output, and I can if I simply
> run the function in a cell without using the macro. (I'm really hoping this
> all makes sense.) I have looked all over these discussion groups, and can't
> quite come up with an answer. When I looked at the msdn site I found this
> answer, "However, background processes such as printing and recalculation
> continue," but am uncertain if this pertains to functions that are add in's
> from another software.
>
> I originally had the do/ while loop continually running without a pause, but
> I couldn't seem to get past the "requesting data" doing that either. If I
> just continually run the loop will Excel still be also continually accessing
> Bloomberg or will it pause that?
>
> Any help would be greatly appreciated. If you have any questions regarding
> this don't hesitate to post. I think this might be a convoluted question.
> Thank you in advance.
>
> --
> Cheers,
> Michelle
> "Anyone who says he can see through women is missing a lot." Groucho Marx

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make onTimer wait until Excel finish database request? news.stofanet.dk Microsoft Excel Programming 2 4th Mar 2007 08:36 PM
Please help with Application.Wait ( ) Steve Microsoft Excel Programming 2 6th Jan 2006 01:23 PM
How can i implement [ Please wait ....!! your request is processing...] page ................. ~Maheshkumar.R Microsoft ASP .NET 4 30th Mar 2005 05:17 PM
"Please wait while Microsoft Outlook Exits" - and wait, and wait, and wait... ste© Microsoft Outlook Discussion 5 4th Jul 2004 05:34 PM
Does ASP.NET wait for the entire request body before executing the ASP page? Peter Strøiman Microsoft ASP .NET 2 28th Oct 2003 05:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:15 PM.