PC Review


Reply
Thread Tools Rate Thread

How to control the Excel VBA Editor Main Window Caption

 
 
stuartt
Guest
Posts: n/a
 
      16th Apr 2008
Excel updates the Caption of the VBA Editor Main Window every time a Macro
runs, adding the text [running]. When the macro is finished, the text is
removed. This causes problems when there are 1000s of calls to macros per
second, and I would like to be able to disable this feature (it still occurs
when the Main Window is hidden).
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      16th Apr 2008
Have you tried

Application.StatusBar = FALSE

I think that just turns off whatever is in the statusbar though.
--
HTH,
Barb Reinhardt



"stuartt" wrote:

> Excel updates the Caption of the VBA Editor Main Window every time a Macro
> runs, adding the text [running]. When the macro is finished, the text is
> removed. This causes problems when there are 1000s of calls to macros per
> second, and I would like to be able to disable this feature (it still occurs
> when the Main Window is hidden).

 
Reply With Quote
 
Charles Williams
Guest
Posts: n/a
 
      16th Apr 2008
This is a known bug in all Excel versions through Excel2007 SP1.
I have not found a way of completely eliminating this problem in all
circumstances, but this may help:

- if you are using VBA UDF's (most common cause of 1000's of calls) then
initiating calculation from VBA stops this happening (create an
Application.Calculate sub which is called every time someone presses F9 etc
by using ONKEY). This will not help if you are using Automatic calculation
mode.

- closing all VBE windows and minimising the VBE helps a bit.

- using Windows API calls to block the Caption refresh does not seem to
help.

- if you close all VBE windows, save, close Excel and then reopen Excel
without opening up the VBE the time taken by the VBE caption refresh will be
somewhat reduced.

- if you convert all your VBA to compiled VB6 the VBE caption will not be
refreshed.

regards
Charles
__________________________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"stuartt" <(E-Mail Removed)> wrote in message
news:9F5353D2-92BD-4C3D-9BBB-(E-Mail Removed)...
> Excel updates the Caption of the VBA Editor Main Window every time a Macro
> runs, adding the text [running]. When the macro is finished, the text is
> removed. This causes problems when there are 1000s of calls to macros per
> second, and I would like to be able to disable this feature (it still
> occurs
> when the Main Window is hidden).



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      16th Apr 2008
Hi Charles,

I've also noticed this, the caption even updates if the VBE has never been
opened in the session of a given instance. However I've not found a fast
enough way of testing if updates occur on each call from a cell formula to a
UDF, or merely on a single calculate event that may trigger many calls. If
the latter the effect would be trivial.

Regards,
Peter T


"Charles Williams" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This is a known bug in all Excel versions through Excel2007 SP1.
> I have not found a way of completely eliminating this problem in all
> circumstances, but this may help:
>
> - if you are using VBA UDF's (most common cause of 1000's of calls) then
> initiating calculation from VBA stops this happening (create an
> Application.Calculate sub which is called every time someone presses F9

etc
> by using ONKEY). This will not help if you are using Automatic calculation
> mode.
>
> - closing all VBE windows and minimising the VBE helps a bit.
>
> - using Windows API calls to block the Caption refresh does not seem to
> help.
>
> - if you close all VBE windows, save, close Excel and then reopen Excel
> without opening up the VBE the time taken by the VBE caption refresh will

be
> somewhat reduced.
>
> - if you convert all your VBA to compiled VB6 the VBE caption will not be
> refreshed.
>
> regards
> Charles
> __________________________________________________
> The Excel Calculation Site
> http://www.decisionmodels.com
>
> "stuartt" <(E-Mail Removed)> wrote in message
> news:9F5353D2-92BD-4C3D-9BBB-(E-Mail Removed)...
> > Excel updates the Caption of the VBA Editor Main Window every time a

Macro
> > runs, adding the text [running]. When the macro is finished, the text is
> > removed. This causes problems when there are 1000s of calls to macros

per
> > second, and I would like to be able to disable this feature (it still
> > occurs
> > when the Main Window is hidden).

>
>



 
Reply With Quote
 
stuartt
Guest
Posts: n/a
 
      16th Apr 2008
Hi, thanks for the suggestions Charles. Just a little further inforamtion, I
found this problem whilst investigating an increase in the percentage CPU
utilization of the explorer.exe process. Explorer has a Shell Hook that is
triggered by the windows redraw events, presumably so that it can update the
buttons on the task bar with the correct window caption text. Monitoring
explorer with spy++ I found that excel was triggering thousands of messages
that were being processed by explorer. So this issue can definitely be
responsible for serious system degradation.
Stuart.

"Peter T" wrote:

> Hi Charles,
>
> I've also noticed this, the caption even updates if the VBE has never been
> opened in the session of a given instance. However I've not found a fast
> enough way of testing if updates occur on each call from a cell formula to a
> UDF, or merely on a single calculate event that may trigger many calls. If
> the latter the effect would be trivial.
>
> Regards,
> Peter T
>
>
> "Charles Williams" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > This is a known bug in all Excel versions through Excel2007 SP1.
> > I have not found a way of completely eliminating this problem in all
> > circumstances, but this may help:
> >
> > - if you are using VBA UDF's (most common cause of 1000's of calls) then
> > initiating calculation from VBA stops this happening (create an
> > Application.Calculate sub which is called every time someone presses F9

> etc
> > by using ONKEY). This will not help if you are using Automatic calculation
> > mode.
> >
> > - closing all VBE windows and minimising the VBE helps a bit.
> >
> > - using Windows API calls to block the Caption refresh does not seem to
> > help.
> >
> > - if you close all VBE windows, save, close Excel and then reopen Excel
> > without opening up the VBE the time taken by the VBE caption refresh will

> be
> > somewhat reduced.
> >
> > - if you convert all your VBA to compiled VB6 the VBE caption will not be
> > refreshed.
> >
> > regards
> > Charles
> > __________________________________________________
> > The Excel Calculation Site
> > http://www.decisionmodels.com
> >
> > "stuartt" <(E-Mail Removed)> wrote in message
> > news:9F5353D2-92BD-4C3D-9BBB-(E-Mail Removed)...
> > > Excel updates the Caption of the VBA Editor Main Window every time a

> Macro
> > > runs, adding the text [running]. When the macro is finished, the text is
> > > removed. This causes problems when there are 1000s of calls to macros

> per
> > > second, and I would like to be able to disable this feature (it still
> > > occurs
> > > when the Main Window is hidden).

> >
> >

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      16th Apr 2008
Hi Stuart,

> Monitoring explorer
> with spy++ I found that excel was triggering thousands of messages


I see what you mean and answers what I wondered previously! Looks like each
call to a UDF triggers about 5 messages to the VBE window. Strangely, though
not problematic, even editing a cell triggers a number of events to the VBE
window. Spy++ doesn't seem able to monitor messages to the VBE window when
the VBE is closed, which is not surprising (what is surprising is that the
window even exists while the VBE is closed). As I mentioned previously the
window is updated when closed as can verified by be verified by other API
calls.

Regards,
Peter T


"stuartt" <(E-Mail Removed)> wrote in message
news:37CEA827-352D-4B37-9C70-(E-Mail Removed)...
> Hi, thanks for the suggestions Charles. Just a little further inforamtion,

I
> found this problem whilst investigating an increase in the percentage CPU
> utilization of the explorer.exe process. Explorer has a Shell Hook that is
> triggered by the windows redraw events, presumably so that it can update

the
> buttons on the task bar with the correct window caption text. Monitoring
> explorer with spy++ I found that excel was triggering thousands of

messages
> that were being processed by explorer. So this issue can definitely be
> responsible for serious system degradation.
> Stuart.
>
> "Peter T" wrote:
>
> > Hi Charles,
> >
> > I've also noticed this, the caption even updates if the VBE has never

been
> > opened in the session of a given instance. However I've not found a fast
> > enough way of testing if updates occur on each call from a cell formula

to a
> > UDF, or merely on a single calculate event that may trigger many calls.

If
> > the latter the effect would be trivial.
> >
> > Regards,
> > Peter T
> >
> >
> > "Charles Williams" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > This is a known bug in all Excel versions through Excel2007 SP1.
> > > I have not found a way of completely eliminating this problem in all
> > > circumstances, but this may help:
> > >
> > > - if you are using VBA UDF's (most common cause of 1000's of calls)

then
> > > initiating calculation from VBA stops this happening (create an
> > > Application.Calculate sub which is called every time someone presses

F9
> > etc
> > > by using ONKEY). This will not help if you are using Automatic

calculation
> > > mode.
> > >
> > > - closing all VBE windows and minimising the VBE helps a bit.
> > >
> > > - using Windows API calls to block the Caption refresh does not seem

to
> > > help.
> > >
> > > - if you close all VBE windows, save, close Excel and then reopen

Excel
> > > without opening up the VBE the time taken by the VBE caption refresh

will
> > be
> > > somewhat reduced.
> > >
> > > - if you convert all your VBA to compiled VB6 the VBE caption will not

be
> > > refreshed.
> > >
> > > regards
> > > Charles
> > > __________________________________________________
> > > The Excel Calculation Site
> > > http://www.decisionmodels.com
> > >
> > > "stuartt" <(E-Mail Removed)> wrote in message
> > > news:9F5353D2-92BD-4C3D-9BBB-(E-Mail Removed)...
> > > > Excel updates the Caption of the VBA Editor Main Window every time a

> > Macro
> > > > runs, adding the text [running]. When the macro is finished, the

text is
> > > > removed. This causes problems when there are 1000s of calls to

macros
> > per
> > > > second, and I would like to be able to disable this feature (it

still
> > > > occurs
> > > > when the Main Window is hidden).
> > >
> > >

> >
> >
> >



 
Reply With Quote
 
Charles Williams
Guest
Posts: n/a
 
      17th Apr 2008
See
http://www.decisionmodels.com/calcsecretsj.htm

for timing comparisons
(91 seconds reduced to .3 seconds using Application.Calculate rather than
F9)

Charles
__________________________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"stuartt" <(E-Mail Removed)> wrote in message
news:37CEA827-352D-4B37-9C70-(E-Mail Removed)...
> Hi, thanks for the suggestions Charles. Just a little further inforamtion,
> I
> found this problem whilst investigating an increase in the percentage CPU
> utilization of the explorer.exe process. Explorer has a Shell Hook that is
> triggered by the windows redraw events, presumably so that it can update
> the
> buttons on the task bar with the correct window caption text. Monitoring
> explorer with spy++ I found that excel was triggering thousands of
> messages
> that were being processed by explorer. So this issue can definitely be
> responsible for serious system degradation.
> Stuart.
>
> "Peter T" wrote:
>
>> Hi Charles,
>>
>> I've also noticed this, the caption even updates if the VBE has never
>> been
>> opened in the session of a given instance. However I've not found a fast
>> enough way of testing if updates occur on each call from a cell formula
>> to a
>> UDF, or merely on a single calculate event that may trigger many calls.
>> If
>> the latter the effect would be trivial.
>>
>> Regards,
>> Peter T
>>
>>
>> "Charles Williams" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > This is a known bug in all Excel versions through Excel2007 SP1.
>> > I have not found a way of completely eliminating this problem in all
>> > circumstances, but this may help:
>> >
>> > - if you are using VBA UDF's (most common cause of 1000's of calls)
>> > then
>> > initiating calculation from VBA stops this happening (create an
>> > Application.Calculate sub which is called every time someone presses F9

>> etc
>> > by using ONKEY). This will not help if you are using Automatic
>> > calculation
>> > mode.
>> >
>> > - closing all VBE windows and minimising the VBE helps a bit.
>> >
>> > - using Windows API calls to block the Caption refresh does not seem to
>> > help.
>> >
>> > - if you close all VBE windows, save, close Excel and then reopen Excel
>> > without opening up the VBE the time taken by the VBE caption refresh
>> > will

>> be
>> > somewhat reduced.
>> >
>> > - if you convert all your VBA to compiled VB6 the VBE caption will not
>> > be
>> > refreshed.
>> >
>> > regards
>> > Charles
>> > __________________________________________________
>> > The Excel Calculation Site
>> > http://www.decisionmodels.com
>> >
>> > "stuartt" <(E-Mail Removed)> wrote in message
>> > news:9F5353D2-92BD-4C3D-9BBB-(E-Mail Removed)...
>> > > Excel updates the Caption of the VBA Editor Main Window every time a

>> Macro
>> > > runs, adding the text [running]. When the macro is finished, the text
>> > > is
>> > > removed. This causes problems when there are 1000s of calls to macros

>> per
>> > > second, and I would like to be able to disable this feature (it still
>> > > occurs
>> > > when the Main Window is hidden).
>> >
>> >

>>
>>
>>



 
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
stop VB editor main window from coming up Associates Microsoft Access VBA Modules 3 28th Oct 2009 03:13 PM
Referencing main app window from a custom control Peter Microsoft VB .NET 3 9th Apr 2007 05:01 PM
how to show time on the caption of excel window? =?Utf-8?B?c2hvdyB0aW1lIG9uIHRoZSBjYXB0aW9uIG9mIGV4 Microsoft Excel Programming 3 8th Mar 2005 12:50 AM
Can VS.NET code editor window be used as a control? Dean Slindee Microsoft VB .NET 2 25th Aug 2004 09:01 PM
Change caption of main access window JB Microsoft Access 2 31st Oct 2003 02:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:18 PM.