MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Application.ScreenUpdating=TRUE - (TOUGH QUESTION!)

  Asked By: Conrad    Date: Jan 19    Category: MS Office    Views: 3687

I have an Excel Application where I display a UserForm Panel.
Initially right before the UserForm.Show statement, I do the
Reason being, is because when the UserForm Panel is displayed and the person
slides the panel around on top of a Chart
This prevents the non-refresh BLUEISH images sliding all over the Chart from the
displayed UserForm Panel.

The ( TOUGH QUESTION ) is this:
In this UserForm Panel, I have a list of items in a ListBox
When I select a particular item from the list
Then in the VBA code for this ListBox, I do the
Application.ScreenUpdating=FALSE to turn off the Chart flickering of the current
VBA code being executed
After when this VBA code is completed, then I do the
PROBLEM is this, everytime when selecting a item from this ListBox
It causes the Chart to flicker at each completion of the VBA code, because of
the Application.ScreenUpdating=TRUE
If I do the Application.ScreenUpdating=FALSE in the ListBox selection code and
not do the Application.ScreenUpdating=TRUE at the end of the code.
Every time when I do select an item from this ListBox, it is so clean ( no
flickering at all )
However when I move/slide the UserForm Panel around, the non-refresh BLUEISH
images are all over the Chart...( SIGH )
How can I fix this, so it can be very clean for each item selected from this
Listbox and yet prevent non-refresh BLUEISH images ?
Any ideas ?



5 Answers Found

Answer #1    Answered By: Birke Fischer     Answered On: Jan 19

This may be a little drastic, but what about hiding the entire worksheet
while the UserForm is displayed using Application.ActiveSheet.Visible =
False? I've never tried hiding a doc while a UserForm is displayed --
I'm not sure it will work, and I'm also not sure it would provide a
suitable effect for you.

Answer #2    Answered By: Thomas Thompson     Answered On: Jan 19

I came across some code to actually LOCK the position of any UserForm being
which prevents the person to slide it around on the screen.

Answer #3    Answered By: Morris Hughes     Answered On: Jan 19

Bring up the ChartTest Excel Pgm and click on the button(top area of the chart).
Sub StartTest()
Application.ScreenUpdating = True
End Sub

This will display the UserForm panel w/command button.
The subroutine(TestChrt) is called inside the command button, which contains
only 3 lines of code.
Private Sub CommandButton1_Click()
Call TestChrt
End Sub

The purpose of this whole thing, is that everytime when selecting the button
At completion( end ) of the code, there is this line of code...>
"Application.ScreenUpdating = True"
As a result of this, it causes the chart to flicker each time.
Try comment out this line and watch what happens.
NO Flicker at all, but slide the panel around some.
The panel images will repaint itself on top of the chart, because the
"Application.ScreenUpdating = True" is not executed.

What I would like to do, is to prevent the flickering of the Chart.
And also have the UserForm(panel) displayed without repainting itself when
sliding it around.

Sub TestChrt()
Application.ScreenUpdating = False
Application.ScreenUpdating = True
End Sub

Answer #4    Answered By: Leo Evans     Answered On: Jan 19

We don't allow
posting of attachments due to some spammers.

Answer #5    Answered By: Gina Tanaka     Answered On: Jan 19

I am sure somebody has the solution for this flickering and help solve this.
I thought about Deactivating the chart somehow, yet keep it displayed.
I couldn't seem to do this...( sigh )

Many of the VBA Excel problem solvers must still be on vacation for the
holidays...( sigh )
For those of you who would like try this Chart and to look at the VBA code

Didn't find what you were looking for? Find more on Application.ScreenUpdating=TRUE - (TOUGH QUESTION!) Or get search suggestion and latest updates.