Bug 52603 - Excel Visual Basic compatibility issue in LibreOffice Calc: "Application.ScreenUpdating = False" does not work!
Summary: Excel Visual Basic compatibility issue in LibreOffice Calc: "Application.Scre...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
Reported: 2012-07-27 19:58 UTC by Tor24_1975314
Modified: 2019-12-11 10:13 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

Excel test file with macro (38.00 KB, application/vnd.ms-excel)
2012-07-27 19:58 UTC, Tor24_1975314

Note You need to log in before you can comment on or make changes to this bug.
Description Tor24_1975314 2012-07-27 19:58:51 UTC
Created attachment 64805 [details]
Excel test file with macro

The Excel Visual Basic code "Application.ScreenUpdating = False" does not work or will be ignored.
Because this code will be ignored it is not possible to disable the updating of the screen and some macros are working very slow in LibreOffice!

Try to run the example macro in Excel and compare it with LibreOffice Calc.
Example macro:

Sub Test_ScreenUpdating()
    ' Testing Excel VBA Code in Libre Office:
    Application.ScreenUpdating = False

    For i = 1 To 10000
        ActiveCell.Offset(1, 0).Select
    Next i
    Application.ScreenUpdating = True
End Sub
Comment 1 Tor24_1975314 2012-09-02 11:45:57 UTC
This bug occurs in LibreOffice version 3.5.6 and 3.6.1 also
Comment 2 Julien Nabet 2014-02-09 16:22:24 UTC
On pc Debian x86-64 with master sources updated yesterday, I can reproduce this.

Noel: I checked on Opengrok, a setScreenUpdating method exists but is never called, see:
See also:
Are we near the goal with all this?
Comment 3 Tor24_1975314 2014-02-18 18:49:30 UTC
This bug was also reproduced in newer versions of LibreOffice for Windows! 
Tested with LibreOffice versions:, and

Moreover to that the last version of LibreOffice shows a significant performance degradation to scroll down through cells via macro!!!

Needed time to scroll down through 10000 cells:
LibreOffice 00:15 [mm:ss]
LibreOffice 00:15 [mm:ss]
LibreOffice 01:38 [mm:ss] (!!!)

Needed time with Excel to compare:
Excel 2010 with "Application.ScreenUpdating = False": ~00:01 [mm:ss]
Excel 2010 with "Application.ScreenUpdating = True" :  00:05 [mm:ss]

(Test system: Windows 7 64-bit, Intel Core2Duo P8700 2.53 Ghz, 4 GB RAM, Java SE Runtime Environment build 1.6.0_24-b07)

Could anybody reproduce the bug and the performance degradation in LibreOffice 4.2.0?
Comment 4 Tor24_1975314 2014-05-04 14:48:13 UTC
This bug was reproduced also in LibreOffice Calc version and rc!
Comment 5 QA Administrators 2015-06-08 14:41:26 UTC Comment hidden (obsolete)
Comment 6 Tor24_1975314 2015-06-15 21:43:02 UTC
The problem still exists!

This bug was also reproduced in LibreOffice!
Comment 7 Julien Nabet 2015-06-17 17:19:29 UTC
I searched a bit and all the mechanism for this seems to be there, here's a bt when I'm on "ScreenUpdating=false"

(gdb) bt
#0  0x00002aaaca2c5ae1 in ScModelObj::lockControllers() (this=0x29c1920) at /home/julien/compile-libreoffice/libreoffice/sc/source/ui/unoobj/docuno.cxx:1652
#1  0x00002aaaae1d86c7 in basic::vba::(anonymous namespace)::lclLockControllers(com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&, bool) (rxModel=uno::Reference to (ScModelObj *) 0x29c19b0, bLockControllers=true) at /home/julien/compile-libreoffice/libreoffice/basic/source/basmgr/vbahelper.cxx:110
#2  0x00002aaaae1d8b05 in basic::vba::(anonymous namespace)::lclIterateDocuments(basic::vba::(anonymous namespace)::ModifyDocumentFunc, com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&, bool) (pModifyDocumentFunc=0x2aaaae1d8685 <basic::vba::(anonymous namespace)::lclLockControllers(com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&, bool)>, rxModel=uno::Reference to (ScModelObj *) 0x29c19b0, bModificator=true)
    at /home/julien/compile-libreoffice/libreoffice/basic/source/basmgr/vbahelper.cxx:164
#3  0x00002aaaae1d8c18 in basic::vba::lockControllersOfAllDocuments(com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&, bool) (rxModel=uno::Reference to (ScModelObj *) 0x29c19b0, bLockControllers=true) at /home/julien/compile-libreoffice/libreoffice/basic/source/basmgr/vbahelper.cxx:187
#4  0x00002aaacfaf5f15 in VbaApplicationBase::setScreenUpdating(unsigned char) (this=0x2e79030, bUpdate=0 '\000')
    at /home/julien/compile-libreoffice/libreoffice/vbahelper/source/vbahelper/vbaapplicationbase.cxx:193

Eike: any idea why the document view locking mechanism doesn't work here?
Comment 8 Tor24_1975314 2016-06-26 14:29:36 UTC
This problem still exists and was reproduced in LibreOffice versions,, and for Windows.

(Test system: Windows 7 64-bit, Intel Core2Duo P8700 2.53 Ghz, 4 GB RAM, Java SE Runtime Environment build 1.6.0_24-b07)
Comment 9 Xisco Faulí 2017-06-12 11:53:55 UTC
Changing version back to the earliest affected version.
Comment 10 Tor24_1975314 2017-11-05 20:48:07 UTC
Bug also reproduced with LibreOffice version 5.4.2 (Version for Windows)
Comment 11 QA Administrators 2019-07-30 03:15:41 UTC Comment hidden (obsolete)
Comment 12 CM 2019-12-11 10:13:52 UTC
Bug also reproduced with LibreOffice Version (x64) for Windows.  W10 platform. Tested using Calc.
lockControllers / unlockControllers  doesn't function either and may be related.
It would be really useful to get this fixed for performance reasons.