ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Screenupdating = FALSE not working (https://www.excelbanter.com/excel-programming/437021-screenupdating-%3D-false-not-working.html)

VBAActuary

Screenupdating = FALSE not working
 
I have an Excel model with several VBA macros that I have been maintaining in
Excel 2003 for years with no issues. I recently updated to Office 2007, made
some adjustments to the model, and it works fine on my machine (and fine on
some of my coworkers' machines). However, the exact same file when run on
other coworkers' machines is having issues where the
"Application.screenupdating" is being set to true whenever the code switches
worksheets or workbooks. For example:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Select
'At this point, Screenupdating=FALSE on some machines and TRUE on others
Range("Range 3").Select
Selection.Validation.Delete
Application.Screenupdating = TRUE
End Sub

Again, when running on some machines - no problem (screenupdating remains
set to false at all times), but when run on another machines, it switches to
true. We all are running Office 2007. I have seen many posts on various
forums regarding similar issues, but nothing regarding screenupdating working
on one machine but not another.

Is there an Excel Options setting that could be different between our
machines that could be causing this? Thanks for any help.

JLGWhiz[_2_]

Screenupdating = FALSE not working
 
Try it this way:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Range("Range 3").Validation.Delete
Application.Screenupdating = TRUE
End Sub



"VBAActuary" wrote in message
...
I have an Excel model with several VBA macros that I have been maintaining
in
Excel 2003 for years with no issues. I recently updated to Office 2007,
made
some adjustments to the model, and it works fine on my machine (and fine
on
some of my coworkers' machines). However, the exact same file when run on
other coworkers' machines is having issues where the
"Application.screenupdating" is being set to true whenever the code
switches
worksheets or workbooks. For example:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Select
'At this point, Screenupdating=FALSE on some machines and TRUE on others
Range("Range 3").Select
Selection.Validation.Delete
Application.Screenupdating = TRUE
End Sub

Again, when running on some machines - no problem (screenupdating remains
set to false at all times), but when run on another machines, it switches
to
true. We all are running Office 2007. I have seen many posts on various
forums regarding similar issues, but nothing regarding screenupdating
working
on one machine but not another.

Is there an Excel Options setting that could be different between our
machines that could be causing this? Thanks for any help.




VBAActuary

Screenupdating = FALSE not working
 
Thank you for the response. Unfortunately, the code I provided as an example
is an extremely simplified excerpt from the larger model (I should have
clarified). The model contains thousands of lines of code over several
modules and userforms, and requires the opening and closing of other Excel
workbooks. So I need to understand what is causing the issue, as
unfortunately I don't think any easy work-around will suffice here.

"JLGWhiz" wrote:

Try it this way:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Range("Range 3").Validation.Delete
Application.Screenupdating = TRUE
End Sub



"VBAActuary" wrote in message
...
I have an Excel model with several VBA macros that I have been maintaining
in
Excel 2003 for years with no issues. I recently updated to Office 2007,
made
some adjustments to the model, and it works fine on my machine (and fine
on
some of my coworkers' machines). However, the exact same file when run on
other coworkers' machines is having issues where the
"Application.screenupdating" is being set to true whenever the code
switches
worksheets or workbooks. For example:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Select
'At this point, Screenupdating=FALSE on some machines and TRUE on others
Range("Range 3").Select
Selection.Validation.Delete
Application.Screenupdating = TRUE
End Sub

Again, when running on some machines - no problem (screenupdating remains
set to false at all times), but when run on another machines, it switches
to
true. We all are running Office 2007. I have seen many posts on various
forums regarding similar issues, but nothing regarding screenupdating
working
on one machine but not another.

Is there an Excel Options setting that could be different between our
machines that could be causing this? Thanks for any help.



.


JLGWhiz[_2_]

Screenupdating = FALSE not working
 
The best I can do is recommend that you purge your code of the Select method
and use the direct address method as illustrated in the snippet I suggested.
That eliminates the need for the ScreenUpdating in 90 percent of the cases.
Every use of Select tries to trigger a screen update. Some versions of
Excel might react differently to the ScreenUpdating code feature.


"VBAActuary" wrote in message
...
Thank you for the response. Unfortunately, the code I provided as an
example
is an extremely simplified excerpt from the larger model (I should have
clarified). The model contains thousands of lines of code over several
modules and userforms, and requires the opening and closing of other Excel
workbooks. So I need to understand what is causing the issue, as
unfortunately I don't think any easy work-around will suffice here.

"JLGWhiz" wrote:

Try it this way:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Range("Range 3").Validation.Delete
Application.Screenupdating = TRUE
End Sub



"VBAActuary" wrote in message
...
I have an Excel model with several VBA macros that I have been
maintaining
in
Excel 2003 for years with no issues. I recently updated to Office 2007,
made
some adjustments to the model, and it works fine on my machine (and
fine
on
some of my coworkers' machines). However, the exact same file when run
on
other coworkers' machines is having issues where the
"Application.screenupdating" is being set to true whenever the code
switches
worksheets or workbooks. For example:

Sub ProcessName()
Application.Screenupdating = FALSE
Sheets("Sheet 1").Range("Range 1").clearcontents
Sheets("Sheet 2").Range("Range 2").clearcontents
'Up to this point, Screenupdating=FALSE on ALL machines
Sheets("Sheet 3").Select
'At this point, Screenupdating=FALSE on some machines and TRUE on
others
Range("Range 3").Select
Selection.Validation.Delete
Application.Screenupdating = TRUE
End Sub

Again, when running on some machines - no problem (screenupdating
remains
set to false at all times), but when run on another machines, it
switches
to
true. We all are running Office 2007. I have seen many posts on various
forums regarding similar issues, but nothing regarding screenupdating
working
on one machine but not another.

Is there an Excel Options setting that could be different between our
machines that could be causing this? Thanks for any help.



.





All times are GMT +1. The time now is 03:38 PM.

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