no, this is not a safe hour to determine safety of code.  I was thinking "Do
Until" even as reading "Do While".. yours, you're right, has that edge case
issue.

 

The API should do the trick without adding complexity.

 

Asa

 

From: Asa Rossoff [mailto:a...@lovetour.info] 
Sent: Tuesday, April 17, 2012 1:13 AM
To: 'excel-macros@googlegroups.com'
Subject: RE: $$Excel-Macros$$ watch does not break and can filling
spreadsheet be made to scroll?

 

Actually the way you wrote it is safe.

timer always < 86400

start = timer so start < 86400

 

edge case, start=86399.98

then timer becomes 0

do while.. 0 < 86400.01 etc.

easily true, so loop breaks early.

 

An elegant solution, thanks to Windows API:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) ' in module
declarations

Sleep 30 ' in code

 

Asa

 

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Domain Admin
Sent: Tuesday, April 17, 2012 12:36 AM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ watch does not break and can filling
spreadsheet be made to scroll?

 

Oh yeah.  You have to actually paste.

 

        .Cells(maxrow, ReverseDate).Show
        Dim Start
        Start = Timer
        Do While Timer < Start + 0.03
            DoEvents
        Loop



 

On Tue, Apr 17, 2012 at 12:28 AM, Asa Rossoff <a...@lovetour.info> wrote:

Don't see the delay code you refer to, but there are solutions.  you can do
various math gymnastics to get back out of the corner with Timer(), or for
1-second resolution, use Application.Wait (suspends code execution for x
seconds), or Application.OnTime, or Now()*86400 (for any of these, might
check only every x iterations through the loop if any slowdown concern.)

 

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Domain Admin
Sent: Tuesday, April 17, 2012 12:15 AM 


To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ watch does not break and can filling
spreadsheet be made to scroll?

 

Watch working now but I did not change anything.  Weird.  The following
works nicely for the delay though I wonder about a corner case where the
timer started just a fraction before midnight...   but I could just break.

On Mon, Apr 16, 2012 at 11:57 PM, Asa Rossoff <a...@lovetour.info> wrote:

Try setting a watch with "break when value changes", then keep hitting F5 to
resume execution after checking the current value (assuming it breaks for
you).  You may find that the value of maxrow is never set to 111, even if it
eventually surpasses that.. it's either that, I think, or else the context
scope is wrong or Exel is messing with you tonight.

=====

For testing, instead or in addition to range.scroll, you might use
Debug.Print to print the current cell address or other data to the debug
window then scroll though it after the run is complete or at any point code
execution is stopped (there is some max numer of history lines kept)  To
save space in the history you could terminate debug.print with a comma or
semicolon (instead of going to a newline after printing, comma goes to next
tab stop and semicolon simply leaves cursor in-place).

 

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Domain Admin
Sent: Monday, April 16, 2012 11:46 PM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ watch does not break and can filling
spreadsheet be made to scroll?

 

Everything for the watch set up exactly as you describe and the watch window
shows exactly what you said below.

But it does not break.  Program runs to the end though maxrow only shows 111
even though it goes beyond that.

I will figure it out.  

 

Range.show works great though as you say way faster than I can read.  For
using for testing I will slow it down.

 

Thanks yet again.

On Mon, Apr 16, 2012 at 10:53 PM, Asa Rossoff <a...@lovetour.info> wrote:

Hi Howard,

The watch should be setup like this, in the Add Watch window:

Expression:        maxrow = 111

Context -

Procedure:          (procedure with maxrow in scope)

Module:              (module with above procedure)

Watch Type:     Break When Value Is True

 

If you look in the watch window after creating the above watch, and code is
not currently executing, you will see:


Expression

Value

Type

Context


maxrow = 111

<Out of context>

Empty

Modulename.Procedurename

 

It just reflects the settings you used when setting up the watch.

While code is running, if you are in break mode, you'll see the value of the
expression maxrow = 111 (which will be True or False) in the Value column of
the Watch Window as long as the listed context is in the current call stack
(currently executing procedures).  Code execution should stop as soon as the
expression evaluates to True.

 

> Also while the program is running it is filliing in several

> columns of a sheet.  Is there a way to have the sheet scroll

> while filling so the filling rows are visible?

 

Yes, but you should realize it will slow things down considerably.  If it is
a lot of cells getting filled in, it will take much longer, yet you will
probably still end up scrolling faster than they can read.

Some methods of scrolling:

.        RANGE.Show - scrolls so cell represented by RANGE is in center of
window pane; doesn't activate it.  Fails if RANGE is not in active document.

.        RANGE.Select - in the case of a single cell, scrolls to center of
window pane; activates cell (slower)

.        WINDOW.ScrollRow, .ScrollColumn (also PANE.ScrollRow,
.ScrollColumn) - scroll so selected row or column is at upper-left of WINDOW
or PANE.

 

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of tangledweb
Sent: Monday, April 16, 2012 5:47 PM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ watch does not break and can filling spreadsheet
be made to scroll?

 

I set a watch with maxrow=111 and set to break if true.    Program runs and
in the watch window shows maxrow=111    though also some odd message about
out of context but it does not break.  Program runs to the end.  Thoughts?

 

 

Also while the program is running it is filliing in several columns of a
sheet.  Is there a way to have the sheet scroll while filling so the filling
rows are visible?

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

 

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

 

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

 

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to