ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unable to Set Excel ScreenUpdating from ComboBox event (https://www.excelbanter.com/excel-programming/408998-unable-set-excel-screenupdating-combobox-event.html)

[email protected]

Unable to Set Excel ScreenUpdating from ComboBox event
 
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 a
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!

cht13er

Unable to Set Excel ScreenUpdating from ComboBox event
 
On Apr 8, 12:09*pm, wrote:
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 a
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

[email protected]

Unable to Set Excel ScreenUpdating from ComboBox event
 
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.



All times are GMT +1. The time now is 01:35 AM.

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