Search the web
Sign In
New User? Sign Up
ms_excel · for users of microsoft excel
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Tough Problem   Message List  
Reply | Forward Message #33575 of 36032 |
Re: [ms_excel] Tough Problem

David,

As usual, I greatly appreciate your comments. However, I must tell you that it
is not a matter of opening EXCEL and waiting for it to initiate. I have waited
30 minutes, let alone 30 seconds, to fire up the macro and the results are the
same. Moreover, as I noted previously, this code executes flawlessly every time
when I fire it up on my laptop.

I'd still like to find a way to compare the initial state of EXCEL prior to
executing the macro on both machines. There must be something about the initial
state that causes one to consistently hang and the other not.

In any case, thanks again for your interest.

--- On Sat, 1/10/09, David Smart <smartware.consulting@...> wrote:
From: David Smart <smartware.consulting@...>
Subject: Re: [ms_excel] Tough Problem
To: ms_excel@yahoogroups.com
Date: Saturday, January 10, 2009, 8:53 PM











It's not that running the code with the break or stop initiates a
process.

What it does is to allow Excel to fully complete its initialisation. There

must be something in your code that needs this to happen.



Short of having your workbook in a running condition in my own development

environment, I do not have any further ideas on what to look for, sorry.



Maybe you simply need to make this a button-activated process that you run

once Excel has fully loaded. Or put in a delay that runs it after 30

seconds or so of opening the workbook.



Regards, Dave S



----- Original Message -----

From: "Lew Glenn" <lewglenn@yahoo. com>

To: <ms_excel@yahoogroup s.com>

Sent: Sunday, January 11, 2009 10:26 AM

Subject: Re: [ms_excel] Tough Problem



>I put the Stop as the first statement in MALBV as you suggested, then saved

>the code, exited EXCEL, and then restarted. I ran the code and, at each

>Stop, inspected the global variables. In every case the global variables

>had the correct values and the code executed correctly to conclusion. This

>is the same behavior that was obtained by setting the breakpoints. I then

>removed the Stop and reran the code 3 times; each time it ran correctly to

>conclusion.

>

> I then quit EXCEL, restarted, and attempted to run the code (without the

> Stop statement) and it hung --- the same behavior I noted earlier.

>

> It's clear that running the code with the break (or Stop) must initiate

> some process or state that, once initiated, allows the code to run

> correctly thereafter. Do you have any further suggestions for a

> workaround? I want to be able to reliably execute this code with an

> automatic scheduler so the presence of Stop statements won't work for me.

>

> --- On Fri, 1/9/09, David Smart <smartware.consultin g@...> wrote:

> From: David Smart <smartware.consultin g@...>

> Subject: Re: [ms_excel] Tough Problem

> To: ms_excel@yahoogroup s.com

> Date: Friday, January 9, 2009, 7:16 PM

>

>

>

>

>

>

>

>

>

>

>

> > > Have you had breakpoints give you reasonable numbers but

> the routine

>

>> > hang

>

>> > anyway?

>

>>

>

>> No.

>

>

>

> IIRC, your code in the previous subroutines is going out to the net to do

>

> things. Also, IIRC, the code in the MALBV subroutine looked pretty

> benign.

>

>

>

> I would be suspecting any code involved in setting the row limits,

>

> especially if it is any way related to external access outside Excel.

> There

>

> could well be a timing issue.

>

>

>

>> Where would I put the Stop?; at the same location where I put the

>

>> breakpoint(s) ?

>

>

>

> Yes. (Although I can't remember where you put the breakpoints, so this is

> a

>

> generic answer.)

>

>

>

>> And is there then a 'Resume' command which would continue the execution?

>

>

>

> The effect of a stop is the same as hitting a breakpoint. Therefore

>

> anything you can do to step/resume after a breakpoint you can do in

> exactly

>

> the same way after a stop. (There is no "resume" code, you do it all with

>

> the mouse as you would after a breakpoint.)

>

>

>

> The benefit is that the stop is actually in the code, so it will work in

>

> code being executed at Excel start-up.

>

>

>

> As a first test, I'd be putting the stop in as the very first statement in

>

> the MALBV subroutine and inspecting the module global variables for the

> min

>

> and max row limits when it stops there on the next open. Then click the

>

> "run macro" triangle to resume execution and see it if hangs. If the

> limits

>

> are OK and it hangs, then it must be MALBV somewhere, and you have the

>

> opportunity to set other breakpoints before the resume. If the limits are

>

> not OK, then it is something done previously.

>

>

>

> Regards, Dave S

>

>

>

> ----- Original Message -----

>

> From: "Lew Glenn" <lewglenn@yahoo. com>

>

> To: <ms_excel@yahoogrou p s.com>

>

> Sent: Saturday, January 10, 2009 11:30 AM

>

> Subject: Re: [ms_excel] Tough Problem

>

>

>

>> See my response to your queries below. I'm still troubled by the fact the

>

>> code runs fine on my laptop, even if I can kluge it to run with pseudo

>

>> breakpoints on my desktop. In your experience what could possibly cause

>

>> that behavior?

>

>>

>

>> Again, many thanks for your interest.

>

>>

>

>> Lew

>

>>

>

>> --- On Fri, 1/9/09, David Smart <smartware.consulti n g@...> wrote:

>

>> From: David Smart <smartware.consulti n g@...>

>

>> Subject: Re: [ms_excel] Tough Problem

>

>> To: ms_excel@yahoogroup s.com

>

>> Date: Friday, January 9, 2009, 1:44 PM

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>> Problem with breakpoints is that you have to do them after

>

>> Excel has started

>

>>

>

>> and completed its initialisations. By that stage, the symptom might be

>

>>

>

>> gone.

>

>>

>

>>

>

>>

>

>> Have you had breakpoints give you reasonable numbers but the routine hang

>

>>

>

>> anyway?No. I put breakpoints at the first statement after 'rowmin = ...',

>

>> i.e., at 'Colopt = "F"' and at the End Sub statement. The correct values

>

>> for rowmin and rowmax are there in each case and the routine never hangs.

>

>> Moreover, after the execution completes this way, I can remove the

>

>> breakpoints and rerun the code (without debugger mode) and the code does

>

>> not hang --- and I can do this however many times I wish. If I then exit

>

>> EXCEL and restart & run the code (without debugger mode & the

>> breakpoints)

>

>> it always hangs.

>

>>

>

>>

>

>>

>

>> Another option is to put a Stop statement into the code and save the

>

>>

>

>> workbook. This will cause a breakpoint even on the initial execution of

>

>> the

>

>>

>

>> code.Where would I put the Stop?; at the same location where I put the

>

>> breakpoint(s) ? And is there then a 'Resume' command which would continue

>

>> the execution?

>

>>

>

>>

>

>>

>

>> Regards, Dave S

>

>>

>

>>

>

>>

>

>> ----- Original Message -----

>

>>

>

>> From: "Lew Glenn" <lewglenn@yahoo. com>

>

>>

>

>> To: <ms_excel@yahoogrou p s.com>

>

>>

>

>> Sent: Friday, January 09, 2009 10:24 AM

>

>>

>

>> Subject: Re: [ms_excel] Tough Problem

>

>>

>

>>

>

>>

>

>>> I'll try that, but note that when I put breakpoints at the beginning of

>

>>

>

>>> MALBV, the value of rowmin and rowmax are correct.

>

>>

>

>>>

>

>>

>

>>> Do you have ANY idea why this code executes correctly every time on my

>

>>

>

>>> laptop (both running XP and EXCEL 2007)? Is it possible that initial

>

>>

>

>>> settings when EXCEL boots are different? Is it possible to view EXCEL's

>

>>

>

>>> state variables immediately on initiation?

>

>>

>

>>>

>

>>

>

>>> Thanks for the suggestion.

>

>>

>

>>>

>

>>

>

>>> Lew

>

>>

>

>>>

>

>>

>

>>> --- On Thu, 1/8/09, David Smart <smartware.consulti n g@...>

>>> wrote:

>

>>

>

>>> From: David Smart <smartware.consulti n g@...>

>

>>

>

>>> Subject: Re: [ms_excel] Tough Problem

>

>>

>

>>> To: ms_excel@yahoogroup s.com

>

>>

>

>>> Date: Thursday, January 8, 2009, 2:51 PM

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> I'm not seeing the problem either, but I note that the loop

>>> in

>

>>

>

>>> MALBV is

>

>>

>

>>>

>

>>

>

>>> dependent on global variables set in one of the previous subs.

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> The problem might lie there, and MALBV might be trying to loop through a

>

>>

>

>>>

>

>>

>

>>> huge number of rows, and not giving you a chance to terminate it

>

>>

>

>>> gracefully.

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> Put the rowmin and rowmax values into the status bar before your start

>

>>> the

>

>>

>

>>>

>

>>

>

>>> FOR loops in MALBV. You might find that one or both of these has wrong

>

>>

>

>>>

>

>>

>

>>> values.

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> Regards, Dave S

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> ----- Original Message -----

>

>>

>

>>>

>

>>

>

>>> From: "Lew Glenn" <lewglenn@yahoo. com>

>

>>

>

>>>

>

>>

>

>>> To: <ms_excel@yahoogrou p s.com>

>

>>

>

>>>

>

>>

>

>>> Sent: Friday, January 09, 2009 4:31 AM

>

>>

>

>>>

>

>>

>

>>> Subject: Re: [ms_excel] Tough Problem

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>> If you look down at the code I included you will see than MALBV is a

>

>>

>

>>>

>

>>

>

>>>> subroutine that I wrote. It is not an add-in. And, as I pointed out, it

>

>>

>

>>>

>

>>

>

>>>> runs perfectly fine most of the time -- and always when I run this code

>

>>

>

>>>> on

>

>>

>

>>>

>

>>

>

>>>> my laptop.

>

>>

>

>>>

>

>>

>

>>>>

>

>>

>

>>>

>

>>

>

>>>> I've tried to find the problem with the debugger but every time I run

>

>>>> the

>

>>

>

>>>

>

>>

>

>>>> code with breakpoints in subroutine MALBV it executes mormally to

>

>>

>

>>>

>

>>

>

>>>> completion. The ONLY time the code seems to hang is when I first invoke

>

>>

>

>>>

>

>>

>

>>>> EXCEL and run without the debugger and without this subroutine

>>>> commented

>

>>

>

>>>

>

>>

>

>>>> out.

>

>>

>

>>>

>

>>

>

>>>>

>

>>

>

>>>

>

>>

>

>>>> Thanks for your comment.

>

>>

>

>>>

>

>>

>

>>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> Message trimmed

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> [Non-text portions of this message have been removed]

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>> ------------ --------- --------- ------

>

>>

>

>>>

>

>>

>

>>> ---

>

>>

>

>>>

>

>>

>

>>> =========== Footer Revised 28 April 2006======== ==

>

>>

>

>>> PLEASE CHECK EXCEL HELP before posting a message to the forum

>

>>

>

>>> and ask SMART questions

>

>>

>

>>> http://www.catb. org/~esr/ faqs/smart- questions. html

>

>>

>

>>>

>

>>

>

>>> for normal live posts email <ms_excel-normal@ yahoogroups. com>

>

>>

>

>>> for digest email <ms_excel-digest@ yahoogroups. com>

>

>>

>

>>> for no mail email <ms_excel-nomail@ yahoogroups. com>

>

>>

>

>>> To UNSUBSCRIBE email <ms_excel-unsubscri b e@yahoogroups. com>

>

>>

>

>>> ============ ========= ========= ========= ========= =========

>

>>> =====Yahoo!

>

>>

>

>>> Groups Links

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>> [Non-text portions of this message have been removed]

>

>>

>

>>

>

>> ------------ --------- --------- ------

>

>>

>

>> ---

>

>>

>

>> =========== Footer Revised 28 April 2006======== ==

>

>> PLEASE CHECK EXCEL HELP before posting a message to the forum

>

>> and ask SMART questions

>

>> http://www.catb. org/~esr/ faqs/smart- questions. html

>

>>

>

>> for normal live posts email <ms_excel-normal@ yahoogroups. com>

>

>> for digest email <ms_excel-digest@ yahoogroups. com>

>

>> for no mail email <ms_excel-nomail@ yahoogroups. com>

>

>> To UNSUBSCRIBE email <ms_excel-unsubscri b e@yahoogroups. com>

>

>> ============ ========= ========= ========= ========= =========

>> =====Yahoo!

>

>> Groups Links

>

>>

>

>>

>

>>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

> [Non-text portions of this message have been removed]

>

>

> ------------ --------- --------- ------

>

> ---

>

> =========== Footer Revised 28 April 2006======== ==

> PLEASE CHECK EXCEL HELP before posting a message to the forum

> and ask SMART questions

> http://www.catb. org/~esr/ faqs/smart- questions. html

>

> for normal live posts email <ms_excel-normal@ yahoogroups. com>

> for digest email <ms_excel-digest@ yahoogroups. com>

> for no mail email <ms_excel-nomail@ yahoogroups. com>

> To UNSUBSCRIBE email <ms_excel-unsubscrib e@yahoogroups. com>

> ============ ========= ========= ========= ========= ========= =====Yahoo!

> Groups Links

>

>

>





























[Non-text portions of this message have been removed]




Mon Jan 12, 2009 5:49 pm

lewglenn
Offline Offline
Send Email Send Email

Forward
Message #33575 of 36032 |
Expand Messages Author Sort by Date

I'm running a macro in EXCEL 2007 that SOMETIMES appears to be in an infinite loop; when this occurs, the only thing I can do to regain control is to kill...
lewglenn
Offline Send Email
Jan 2, 2009
8:19 pm

Post your code, otherwise nobody can tell what's going on with it. --JP...
Jimmy Pena
d540x
Offline Send Email
Jan 3, 2009
5:11 pm

I tried breakpoints once and did not find them useful. Instead, while editing the macro, with the cursor somewhere within the macro, select Step Into from the...
Eugene Nowlan
ednowlan
Offline Send Email
Jan 3, 2009
6:04 pm

In the following code, when I start up EXCEL and run the macro 'ControlFlow' EXCEL freezes & I can only gain control via ctrl-all-delete. If, however, I...
lewglenn
Offline Send Email
Jan 7, 2009
8:22 pm

not really an expert on macros or vba etc (and not a computer genius either) but could the start up process use so much of the available system resources that...
Martin Topper
mtopper
Offline Send Email
Jan 7, 2009
9:53 pm

Don't think that's the problem since my laptop, which has much less memory, runs the unaltered code just fine. And, again, once the code is run with the call...
Lew Glenn
lewglenn
Offline Send Email
Jan 7, 2009
10:07 pm

I don't recognize MALBV. could it be that it is in a add-in or Resource? and when you first start up excel, the add-in or resource is not available, but the...
Paul Schreiner
paulschreine...
Offline Send Email
Jan 8, 2009
3:34 am

If you look down at the code I included you will see than MALBV is a subroutine that I wrote. It is not an add-in. And, as I pointed out, it runs perfectly...
Lew Glenn
lewglenn
Offline Send Email
Jan 8, 2009
5:31 pm

Paul, I definitely agree that there may be a flaw in the way that subroutine MALBV is constructed but I can't seem to find it.  ... From: Paul Schreiner...
Lew Glenn
lewglenn
Offline Send Email
Jan 8, 2009
5:39 pm

I'm not seeing the problem either, but I note that the loop in MALBV is dependent on global variables set in one of the previous subs. The problem might lie...
David Smart
smartware_co...
Offline Send Email
Jan 8, 2009
10:51 pm

I'll try that, but note that when I put breakpoints at the beginning of MALBV, the value of rowmin and rowmax are correct. Do you have ANY idea why this code...
Lew Glenn
lewglenn
Offline Send Email
Jan 8, 2009
11:24 pm

Problem with breakpoints is that you have to do them after Excel has started and completed its initialisations. By that stage, the symptom might be gone. Have...
David Smart
smartware_co...
Offline Send Email
Jan 9, 2009
9:52 pm

See my response to your queries below. I'm still troubled by the fact the code runs fine on my laptop, even if I can kluge it to run with pseudo breakpoints on...
Lew Glenn
lewglenn
Offline Send Email
Jan 10, 2009
12:30 am

... IIRC, your code in the previous subroutines is going out to the net to do things. Also, IIRC, the code in the MALBV subroutine looked pretty benign. I...
David Smart
smartware_co...
Offline Send Email
Jan 10, 2009
3:20 am

I put the Stop as the first statement in MALBV as you suggested, then saved the code, exited EXCEL, and then restarted. I ran the code and, at each Stop,...
Lew Glenn
lewglenn
Offline Send Email
Jan 10, 2009
11:28 pm

It's not that running the code with the break or stop initiates a process. What it does is to allow Excel to fully complete its initialisation. There must be...
David Smart
smartware_co...
Offline Send Email
Jan 11, 2009
4:54 am

Formula designed assuming data entered in Column B1 to B10000 – Correct the formula according to your requirement, if your data is entered in column D then...
Biju Mathew
bijumathew70
Offline Send Email
Jan 11, 2009
8:36 am

David, As usual, I greatly appreciate your comments. However, I must tell you that it is not a matter of opening EXCEL and waiting for it to initiate. I have...
Lew Glenn
lewglenn
Offline Send Email
Jan 12, 2009
5:49 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help