D
Dave Unger
Hello,
Suddenly, I can't turn off ScreenUpdating (Excel 97). If I set it to
False,
it will show False in the Watch window, Debug.print will also show it
as False,
yet when I slide my cursor over the command line, it shows the value =
True.
It's always worked until now, and the problem seems to coincide with
some
experimentation with Automation, running Excel from Word. I've tried
loading Excel
without any Add-Ins or Personal.xls, to no avail.
The following sample code does NOT turn off screenupdating:
Sub tstUpdate()
Application.ScreenUpdating = False
Cells(1, 1) = "ABCDE"
Application.ScreenUpdating = True
End Sub
But this code works as expected:
Sub tstUpdate()
Dim xlApp As Object, MySht As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
Set MySht = xlApp.Activesheet
xlApp.ScreenUpdating = False
MySht.Cells(1, 1) = "ABCD"
xlApp.ScreenUpdating = True
xlApp.Quit
Set xlApp = Nothing
End Sub
Any help appreciated.
Regards,
Dave
Suddenly, I can't turn off ScreenUpdating (Excel 97). If I set it to
False,
it will show False in the Watch window, Debug.print will also show it
as False,
yet when I slide my cursor over the command line, it shows the value =
True.
It's always worked until now, and the problem seems to coincide with
some
experimentation with Automation, running Excel from Word. I've tried
loading Excel
without any Add-Ins or Personal.xls, to no avail.
The following sample code does NOT turn off screenupdating:
Sub tstUpdate()
Application.ScreenUpdating = False
Cells(1, 1) = "ABCDE"
Application.ScreenUpdating = True
End Sub
But this code works as expected:
Sub tstUpdate()
Dim xlApp As Object, MySht As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
Set MySht = xlApp.Activesheet
xlApp.ScreenUpdating = False
MySht.Cells(1, 1) = "ABCD"
xlApp.ScreenUpdating = True
xlApp.Quit
Set xlApp = Nothing
End Sub
Any help appreciated.
Regards,
Dave