Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default application.wait help


I could really use some help with one. I almost get it but then run
smack into a wall. It's hard to explain but I'll try my best.

Cell A1 receives it's data from another application. It's a pressure
reading.

The user needs to be able to adjust a control knob on a machine that in
effect, changes the value of A1 by controlling the pressure. That part
all works fine. The machine functions, A1 values change like they
should.

As A1 changes, the values of B1 and C1 change as well.

When the desired pressure is met, I have individual control buttons
that run macros to copy A1:C1 to 11 locations on the worksheet in
series.

I'm trying to automate the process so that A1 is monitored and upon
reaching a specified value, will run the macros in series.

To monitor A1, I use M1 as the preset value. When A1=M1 run the first
macro.

At that point, the process needs to wait while an adjustment is made to
the control knob and to another mechanical part. I need a short delay
for the adjustments to be carried out [application.wait with a value..I
have that figured out] As the adjustments are made, A1 < M1 BUT when it
again equals A1, I want the next macro to run.

Application.wait seemed like the answer but it's not because while the
application.wait process is going on, A1 is sitting there in limbo and
the value is not changing while the adjustments are made.

As soon as the application.wait time has expired, my current code calls
the next macro and it's grabbing inaccurate data.

Any and all ideas are welcome! Please, someone that knows VB respond to
me on this. I'm 99% of the way to where I need to be and there's this
one last little hurdle...


--
flowtester
------------------------------------------------------------------------
flowtester's Profile: http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default application.wait help

You could try a API timer. I have posted an example of this a few times that
will allow you to click a button and start the clock, click another to stop
it. It could easily be amended to a countdown.

Can you do that or do you want to mail me the workbook, and I could replace
your Application Wait to a timed countdown?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"flowtester" wrote
in message ...

I could really use some help with one. I almost get it but then run
smack into a wall. It's hard to explain but I'll try my best.

Cell A1 receives it's data from another application. It's a pressure
reading.

The user needs to be able to adjust a control knob on a machine that in
effect, changes the value of A1 by controlling the pressure. That part
all works fine. The machine functions, A1 values change like they
should.

As A1 changes, the values of B1 and C1 change as well.

When the desired pressure is met, I have individual control buttons
that run macros to copy A1:C1 to 11 locations on the worksheet in
series.

I'm trying to automate the process so that A1 is monitored and upon
reaching a specified value, will run the macros in series.

To monitor A1, I use M1 as the preset value. When A1=M1 run the first
macro.

At that point, the process needs to wait while an adjustment is made to
the control knob and to another mechanical part. I need a short delay
for the adjustments to be carried out [application.wait with a value..I
have that figured out] As the adjustments are made, A1 < M1 BUT when it
again equals A1, I want the next macro to run.

Application.wait seemed like the answer but it's not because while the
application.wait process is going on, A1 is sitting there in limbo and
the value is not changing while the adjustments are made.

As soon as the application.wait time has expired, my current code calls
the next macro and it's grabbing inaccurate data.

Any and all ideas are welcome! Please, someone that knows VB respond to
me on this. I'm 99% of the way to where I need to be and there's this
one last little hurdle...


--
flowtester
------------------------------------------------------------------------
flowtester's Profile:

http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default application.wait help


Bob,

By using a timer, is the application put into a suspend mode like with
application.wait?

What I'd really like to be able to do is monitor A1 and compare it to
M1 which is the preset trigger value . Then when A1 equals M1, fire the
macro to copy A1:C1 to their locations.

When A1 = M1, Fire the macro that copies [A1:C1] to [C11:E11]
Then wait while adjustments are made but keep monitoring A1 while the
adjustments are made. That puts the first set of values in place.

Then when A1=M1 and [c11:e11] < [""] fire the macro that copies
[a1:c1] to [c12:e12]. Then wait for adjustments again while continuing
to monitor A1 and when [a1=M1] again, fire the next macro....this time
checking to see that [c12:e12] < [""]....and keep doing this in turn,
allowing time for adjustments between each macro run...until values of
[A1:C1] have been copied and pasted to all 11 locations..being
[C11:E11] on down through [C21:E21]


I will gladly email you the workbook if you want.


--
flowtester
------------------------------------------------------------------------
flowtester's Profile: http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default application.wait help

The timer that I am describing uses events, so it is sharing the CPU with
the other tasks.

But by this description, couldn't you just use worksheet change events to
monitor a cell, and when it reaches a value, fire your macro. The timer
doesn't seem to be needed.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"flowtester" wrote
in message ...

Bob,

By using a timer, is the application put into a suspend mode like with
application.wait?

What I'd really like to be able to do is monitor A1 and compare it to
M1 which is the preset trigger value . Then when A1 equals M1, fire the
macro to copy A1:C1 to their locations.

When A1 = M1, Fire the macro that copies [A1:C1] to [C11:E11]
Then wait while adjustments are made but keep monitoring A1 while the
adjustments are made. That puts the first set of values in place.

Then when A1=M1 and [c11:e11] < [""] fire the macro that copies
[a1:c1] to [c12:e12]. Then wait for adjustments again while continuing
to monitor A1 and when [a1=M1] again, fire the next macro....this time
checking to see that [c12:e12] < [""]....and keep doing this in turn,
allowing time for adjustments between each macro run...until values of
[A1:C1] have been copied and pasted to all 11 locations..being
[C11:E11] on down through [C21:E21]


I will gladly email you the workbook if you want.


--
flowtester
------------------------------------------------------------------------
flowtester's Profile:

http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default application.wait help

Maybe you could use application.ontime to just delay your call to the second
macro.

Chip Pearson has lots of instructions at:
http://www.cpearson.com/excel/ontime.htm

flowtester wrote:

I could really use some help with one. I almost get it but then run
smack into a wall. It's hard to explain but I'll try my best.

Cell A1 receives it's data from another application. It's a pressure
reading.

The user needs to be able to adjust a control knob on a machine that in
effect, changes the value of A1 by controlling the pressure. That part
all works fine. The machine functions, A1 values change like they
should.

As A1 changes, the values of B1 and C1 change as well.

When the desired pressure is met, I have individual control buttons
that run macros to copy A1:C1 to 11 locations on the worksheet in
series.

I'm trying to automate the process so that A1 is monitored and upon
reaching a specified value, will run the macros in series.

To monitor A1, I use M1 as the preset value. When A1=M1 run the first
macro.

At that point, the process needs to wait while an adjustment is made to
the control knob and to another mechanical part. I need a short delay
for the adjustments to be carried out [application.wait with a value..I
have that figured out] As the adjustments are made, A1 < M1 BUT when it
again equals A1, I want the next macro to run.

Application.wait seemed like the answer but it's not because while the
application.wait process is going on, A1 is sitting there in limbo and
the value is not changing while the adjustments are made.

As soon as the application.wait time has expired, my current code calls
the next macro and it's grabbing inaccurate data.

Any and all ideas are welcome! Please, someone that knows VB respond to
me on this. I'm 99% of the way to where I need to be and there's this
one last little hurdle...

--
flowtester
------------------------------------------------------------------------
flowtester's Profile: http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default application.wait help


Dave Peterson Wrote:
Maybe you could use application.ontime to just delay your call to the
second
macro.

Chip Pearson has lots of instructions at:
http://www.cpearson.com/excel/ontime.htm



I thought about that too and I'll bet it would work as a work around.
The thing of it is that the time frame for adjustments can vary because
once the mechanical part adjustment is made you then adjust for a
specific pressure and that sometimes takes a little juggling. It may or
may not fall right into place. You may or may not have to play with the
control knob to get the desired pressure to hold steady at the preset
value you want the captures to occur at.

OnChange was tried first but for whatever reason, it won't pick up the
changes in A1. It just doesn't see them happening. Carriage returns
were added to the back end application that feeds A1 and made no
difference...

Ultimately I think the way I have the code working right now, it's just
firing the macro after application.wait time has been satisfied...

Larry


--
flowtester
------------------------------------------------------------------------
flowtester's Profile: http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default application.wait help

If the change event doesn't work, you could try adding a cell referring to
A1, =A1, which would force the Calculate event, which you could then use.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"flowtester" wrote
in message ...

Dave Peterson Wrote:
Maybe you could use application.ontime to just delay your call to the
second
macro.

Chip Pearson has lots of instructions at:
http://www.cpearson.com/excel/ontime.htm



I thought about that too and I'll bet it would work as a work around.
The thing of it is that the time frame for adjustments can vary because
once the mechanical part adjustment is made you then adjust for a
specific pressure and that sometimes takes a little juggling. It may or
may not fall right into place. You may or may not have to play with the
control knob to get the desired pressure to hold steady at the preset
value you want the captures to occur at.

OnChange was tried first but for whatever reason, it won't pick up the
changes in A1. It just doesn't see them happening. Carriage returns
were added to the back end application that feeds A1 and made no
difference...

Ultimately I think the way I have the code working right now, it's just
firing the macro after application.wait time has been satisfied...

Larry


--
flowtester
------------------------------------------------------------------------
flowtester's Profile:

http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default application.wait help


Bob,

I would like to email the workbook to you but I don't see your email
address. I tried looking it up in the member area but no-go on
that...

Larry


--
flowtester
------------------------------------------------------------------------
flowtester's Profile: http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default application.wait help

Well I won't have the facilities to capture the data as you do, but if you
click on the From field in the header, you will see my addy. Note my spam
filter notice in my signature though.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"flowtester" wrote
in message ...

Bob,

I would like to email the workbook to you but I don't see your email
address. I tried looking it up in the member area but no-go on
that...

Larry


--
flowtester
------------------------------------------------------------------------
flowtester's Profile:

http://www.excelforum.com/member.php...o&userid=29300
View this thread: http://www.excelforum.com/showthread...hreadid=490167



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
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Should I Wait? Chaplain Doug Excel Discussion (Misc queries) 0 February 6th 07 04:58 PM
Application.wait... won't! Peter Rooney Excel Programming 12 November 17th 06 04:31 AM
Application.wait & Blinking Connector Tom Rudski[_2_] Excel Programming 1 March 6th 04 05:36 PM
wait Eddie[_4_] Excel Programming 3 November 15th 03 03:37 PM


All times are GMT +1. The time now is 09:49 PM.

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

About Us

"It's about Microsoft Excel"