ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   NEXT LEVEL OF ScreenUpdating (https://www.excelbanter.com/excel-programming/333800-next-level-screenupdating.html)

Chuckles123[_76_]

NEXT LEVEL OF ScreenUpdating
 

I am using 'Application.ScreenUpdating = False' at the beginning of my
code, and '... = True' at the end. I am getting a grey Excel window on
my screen until the macro shuts down. Is there any way to minimize this
window while the macro is running?

Thanks for a response.


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


jose luis

NEXT LEVEL OF ScreenUpdating
 

Are you Unloading the UserForms that may be you triggered before? That
could be the reason. Could you tell whats in between the ScreenUpdating
lines?

Regards
Jose LUis



Chuckles123 Wrote:
I am using 'Application.ScreenUpdating = False' at the beginning of my
code, and '... = True' at the end. I am getting a grey Excel window on
my screen until the macro shuts down. Is there any way to minimize this
window while the macro is running?

Thanks for a response.



--
jose luis
------------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Chuckles123[_77_]

NEXT LEVEL OF ScreenUpdating
 

Thanks for your interest.

My code contains no UserForms.

My code opens and closes several Excel files plus one Word file. The
first Excel file that is opened remains open during macro processing; 3
of its WorkSheets are saved to a folder as individual files; depending
on value of a key cell, various Outlook e-mails are created and sent;
my macro shuts down the Excel application without saving the original
file opened.

HTH
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Rich_z[_24_]

NEXT LEVEL OF ScreenUpdating
 

Try including the keyword 'DoEvents' in your code at various places -
inside loops, and the start and end of any subroutines.

DoEvents releases the timeslice back to windows allowing it to process
other events that are waiting to be processed. Whilst this won't allow
you to minimise the window it may get rid of your grey box.


--
Rich_z
------------------------------------------------------------------------
Rich_z's Profile: http://www.excelforum.com/member.php...o&userid=24737
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Chuckles123[_78_]

NEXT LEVEL OF ScreenUpdating
 

I checked VB Help on 'DoEvents'; I also searched all the posts on this
site for the same thing.

I think 'DoEvents' may be overkill for my needs. I do not have any
UserForms in my code, I open and close maybe 10 Excel workbooks, I have
a few loops and a few subroutines but they are executed quickly.

I was confused by your line: "Whilst this won't allow you to minimise
the window it may get rid of your grey box." My grey box is the Excel
window; all that I want to do is make this grey box/Excel window not
appear on my screen. I don't mind, in fact I appreciate, application
file buttons appearing and disappearing in the XP Taskbar.

Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


jose luis

NEXT LEVEL OF ScreenUpdating
 

Hi Chuckles, sorry not been able to answer this before. Some times I'm
getting the the gray area that you describes too. I haven't been able
to catch the error. What i have noticed is that it appears after the
opening of several hmtl pages via the Explorer, unfortunately i can't
repeat the error at will, so i dont't understand why it surges. After
closing my files, quitting excel and sometimes restarting the PC it
disparears.

Hope this helps you in some way :(

Regards

Jose Luis


Chuckles123 Wrote:
I checked VB Help on 'DoEvents'; I also searched all the posts on this
site for the same thing.

I think 'DoEvents' may be overkill for my needs. I do not have any
UserForms in my code, I open and close maybe 10 Excel workbooks, I have
a few loops and a few subroutines but they are executed quickly.

I was confused by your line: "Whilst this won't allow you to minimise
the window it may get rid of your grey box." My grey box is the Excel
window; all that I want to do is make this grey box/Excel window not
appear on my screen. I don't mind, in fact I appreciate, application
file buttons appearing and disappearing in the XP Taskbar.

Chuckles123



--
jose luis
------------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Chuckles123[_84_]

NEXT LEVEL OF ScreenUpdating
 

Jose,

Prior to using 'Application.ScreenUpdating = False', when my macro was
executed, I saw all of the sheet changes and calculations taking place
in an Excel window.
All of this screen updating had a negative impact on macro execution
speed; OK, I then added the above setting to the beginning of my macro.
Execution speed was greatly enhanced: I still saw a pop-up Excel
window but it only had a grey box in it, with no screen changes (that
is until the macro was finished and the macro terminated Excel --
obviously, then, the pop-up went away). OK, now I want to mimimize the
pop-up Excel window with the grey box during macro execution.

Any ideas?
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


jose luis

NEXT LEVEL OF ScreenUpdating
 

Hi Chuckles,


I think your problem lies in some of the subroutines or UserForms that
your Macro is calling, May be some of them should include
'Application.ScreenUpdating = False/True. In order to find out where in
the code the gray box is poping out, have you think use the F8 key in
order to run the macro step by step. That way you could catch the exact
point where the gray area appears.

Hope this helps in some way

Regards

Jose Luis

Chuckles123 Wrote:
Jose,

Prior to using 'Application.ScreenUpdating = False', when my macro was
executed, I saw all of the sheet changes and calculations taking place
in an Excel window.
All of this screen updating had a negative impact on macro execution
speed; OK, I then added the above setting to the beginning of my macro.
Execution speed was greatly enhanced: I still saw a pop-up Excel
window but it only had a grey box in it, with no screen changes (that
is until the macro was finished and the macro terminated Excel --
obviously, then, the pop-up went away). OK, now I want to mimimize the
pop-up Excel window with the grey box during macro execution.

Any ideas?
Chuckles123



--
jose luis
------------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Chuckles123[_85_]

NEXT LEVEL OF ScreenUpdating
 

Jose,

As I said before, there are no UserForms in my code. I do have 10
Modules, with interactive Calls, stored in an .xlA file (this file is
NOT set-up as an 'Add-In' in Excel). At the beginning of each Module,
I set ScreenUpdating = False.

Also, ScreenUpdating cannot be debugged via stepping through code using
the F8 key; when stepping through, ScreenUpdating is automatically set
to True (unless you minimize the non-VB window in the .xlA file, in
which case any workbooks opened will be minimized as well; however,
this does not help to replicate what will happen when an user runs the
macro).

Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Rich_z[_29_]

NEXT LEVEL OF ScreenUpdating
 

Look at what is happening - you open several workbooks and the system
gets busy. Although windows is almost a multi tasking system, it
still does things in a linear fashion. An application gets control,
does something and then releases control. The next app then has a go.
In other words, it's not a preemptive multitasking system - the time
slice is not ripped out from under the apps feet.

So you get some apps which hog the system, other events are not
processed in a timely fashion.

Whilst what I'm talking about is not preventing the grey box from
appearing, what I'm trying to achieve is that it is only visible for a
short(er) period of time.

By using Doevents you release your timeslice back to the system which
can then process any pending events which should hopefully refresh the
screen in a more timely fashion.

Regards

Rich


--
Rich_z
------------------------------------------------------------------------
Rich_z's Profile: http://www.excelforum.com/member.php...o&userid=24737
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Chuckles123[_86_]

NEXT LEVEL OF ScreenUpdating
 

Rich,

I inserted a MsgBox before the first line of executable code. The
macro is named 'Auto_Open()' and is triggered via a Windows' Scheduled
Task. The grey box appears when the MsgBox does (actually, the user
has to click on the application button in the XP Taskbar); the result
is the same when inserting 'Applicatiion.ScreenUpdating = False' before
the MsgBox.

In my .xlA macro file, I have VBA code but the Excel counterpart of my
code is a grey window. I guess I could export each of my 10 modules
into a blank workbook, store it as an .xlS file (not sure if that makes
any difference), and most importantly, make sure that the Excel
counterpart has gridlines.

Any comments?

Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=385041


Rich_z[_35_]

NEXT LEVEL OF ScreenUpdating
 

Any comments?<<


Hmmmmmmmm........

For a start....

The grey box appears when the macro starts. It persists until th
macro ends.

It all points to Windows not processing it's message queue fast enough
Your macro starts-Grey box. Your macro ends-No grey box.

The more I think about it, the more I'm convinced that it's all to d
with the above.

Have you managed to figure out what the grey box is yet ? Is an empt
tool bar ? Could it be part of another window showing where the scree
has yet to be refreshed ?

The fact that your message box is displayed is because it is waitin
for user input so it has relinquished control.

Just out of interest (I can't remember whether you've said so or not),
have you tried placing doevents statements in your code ? Especially i
loops ?

One of the reasons why I'm convinced (I may be wrong though...) tha
it's all to do with the above is that I use Excel on a regular basis a
a halfway house for legacy data on it's way from mainframe systems bein
uploaded into SAP. This data can take up many spreadsheets in
workbook and contains hundreds of thousands of rows in some case
(especially whey you're dealing with general ledger postings etc) We d
lots of validation and data cleaning, all automated with VBA. Withou
liberal usage of Doevents in the code, windows don't open, screen
don't refresh and you also get blank boxes (not always grey though....
that persist until the macro ends. As these things run for hours that'
a bit of a problem....

By using DoEvents, you can get your system to work with almost n
degradation while these things churn away in the background.

The more I type, the more I'm convinced.

Let me know.

Regards

Ric

--
Rich_
-----------------------------------------------------------------------
Rich_z's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread.php?threadid=38504


Chuckles123[_87_]

NEXT LEVEL OF ScreenUpdating
 

I created two new files: DUMMY.xlS and DUMMY.xlA (I created a ver
simple macro for each -- merely a MsgBox); the spreadsheet view of eac
file is a "blank new worksheet".

Interesting Point #1: When opening each file without digita
signatures, the initial spreadsheet view is a grey screen with a pop-u
requesting Enable or Disable Macros; upon selecting one of these, th
horizontal and vertical cell division lines appear.

Interesting Point #2: My .xlA file with a digital signature (if no
stored in the 'AddIns' folder, I think there is zero distinctio
between .xlA files and .xlS files) containing 10 Modules has only
grey screen for a spreadsheet view, with the caption of 'Microsof
Excel' (as opposed to a file name) at the top of the grey screen.
Could digitally signing my .xlA file have caused the spreadsheet vie
to convert to a grey screen??? After testing, I have decided that th
answer is no.

It's like the spreadsheet view has been deleted from my macro file.
have no idea how I managed to do this.

Chuckles12

--
Chuckles12
-----------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494
View this thread: http://www.excelforum.com/showthread.php?threadid=38504


narutard[_22_]

NEXT LEVEL OF ScreenUpdating
 

did u try screenupdating true/false ONLY at the beginning and end of u
main module that you use to call the others from

--
narutar
-----------------------------------------------------------------------
narutard's Profile: http://www.excelforum.com/member.php...fo&userid=2511
View this thread: http://www.excelforum.com/showthread.php?threadid=38504


Chuckles123[_89_]

NEXT LEVEL OF ScreenUpdating
 

I have synthesized several posts into one and clarified my mission
check-out my post of today -- 'How Invisible Can You Make You
Code???'.

Chuckles123

P.S.: For my needs, App.Visible=F/T appears to work better tha
App.ScrUpdating=F/T

--
Chuckles12
-----------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494
View this thread: http://www.excelforum.com/showthread.php?threadid=38504


Bruce001[_11_]

NEXT LEVEL OF ScreenUpdating
 

I am also running into this "gray line" at the top of my Excel window
It occurs when I open an external file and stays from there on
covering the top line of each sheet.

Anybody else have any suggestions

--
Bruce00
-----------------------------------------------------------------------
Bruce001's Profile: http://www.excelforum.com/member.php...fo&userid=2663
View this thread: http://www.excelforum.com/showthread.php?threadid=38504



All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com