Unable to Set Excel ScreenUpdating from ComboBox event

  • Thread starter Thread starter unowho247
  • Start date Start date
U

unowho247

I am using several Combo Boxes on a workbook to set views for a data
table and chart. I am close to being done with this project, however,
I'm trying to eliminate some screen flicker... The
Application.ScreenUpdating = False attempt at line 3 doesn't cause any
errors, but it doesn't change the property of Excel either. If I step
into the code in break mode, nothing happens either. However in break
mode, if I type the line into the immediate pane, the property
changes.

Has anyone seen this happen before? I can't determine if it is by
design or simply some sort of bug this workbook is going through...

Current project references are:
VBA
MS Excel 11.0
OLE Automation
MS Office 11.0
MS Forms 2.0

Example Code:

Private Sub cmb_Element_Click()
If c_call Then Exit Sub
Application.ScreenUpdating = False
Call ReplaceTarget
Call TargetChart_Range
Me.cmb_TimePeriod.Visible = True
Me.cmb_Paper.Visible = True
If Me.cmb_Element.List(Me.cmb_Element.ListCount - 1, 0) = "<Select
Element>" Then
Me.cmb_Element.RemoveItem Me.cmb_Element.ListCount - 1
End If
Application.ScreenUpdating = True
Me.Range("C35").Select
End Sub

Thanks for any help!
 
I am using several Combo Boxes on a workbook to set views for a data
table and chart.  I am close to being done with this project, however,
I'm trying to eliminate some screen flicker... The
Application.ScreenUpdating = False attempt at line 3 doesn't cause any
errors, but it doesn't change the property of Excel either.  If I step
into the code in break mode, nothing happens either.  However in break
mode, if I type the line into the immediate pane, the property
changes.

Has anyone seen this happen before?   I can't determine if it is by
design or simply some sort of bug this workbook is going through...

Current project references are:
VBA
MS Excel 11.0
OLE Automation
MS Office 11.0
MS Forms 2.0

Example Code:

Private Sub cmb_Element_Click()
   If c_call Then Exit Sub
Application.ScreenUpdating = False
   Call ReplaceTarget
   Call TargetChart_Range
   Me.cmb_TimePeriod.Visible = True
   Me.cmb_Paper.Visible = True
   If Me.cmb_Element.List(Me.cmb_Element.ListCount - 1, 0) = "<Select
Element>" Then
         Me.cmb_Element.RemoveItem Me.cmb_Element.ListCount - 1
   End If
Application.ScreenUpdating = True
Me.Range("C35").Select
End Sub

Thanks for any help!

Private Sub cmb_Element_Click()
If c_call Then
Exit Sub
End If

etc ....

What's c_call? Should that be "If c_call = True Then " ...

Don't know if this is the problem, but it might be :P

Chris
 
c_call is a global boolean variable I use to prevent activation of
combo box events when running other procedures. so no, it doesn't
have anything to do with this issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top