Bug 149559 - Excel Visual Basic compatibility issue in LibreOffice Calc: Application.ScreenUpdating = False does not always work
Summary: Excel Visual Basic compatibility issue in LibreOffice Calc: Application.Scree...
Status: RESOLVED DUPLICATE of bug 52603
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2022-06-14 03:32 UTC by Óvári
Modified: 2022-06-20 00:12 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
ScreenUpdating.xls (26.50 KB, application/vnd.ms-excel)
2022-06-14 03:37 UTC, Óvári
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Óvári 2022-06-14 03:32:49 UTC
Description:
This issue illustrates a problem shown in bug 149325. Hopefully ScreenUpdating is easier to fix as this is a smaller file illustrating the situation.

ScreenUpdating can be set to true/false to enable/disable the screen updating when code is run.

Disabling ScreenUpdating improves the speed of code execution. The code is:
Application.ScreenUpdating = False

ScreenUpdating can be enabled after the block of code with:
Application.ScreenUpdating = True

Steps to Reproduce:
The attached Microsoft Excel spreadsheet has two subroutines, ScreenUpdateTestWorks() and ScreenUpdateTestFails()

Actual Results:
Correct behavior: Subroutine ScreenUpdateTestWorks() show a sheet with all the cells look empty (as the screen is not updating) when the MsgBox states:
All the data is entered into the cells. The application will update the screen when you press OK to see the data.

Correct behavior: Subroutine ScreenUpdateTestFails() show a sheet with all the cells incorrectly showing populated when the MsgBox states:
All the data is entered into the cells. The application will update the screen when you press OK to see the data.

The only difference between the ScreenUpdateTestWorks() and ScreenUpdateTestFails() is that ScreenUpdateTestWorks() has the line
MsgBox "All cells in this sheet should be empty."

Expected Results:
Both subroutines should show a sheet with all the cells look empty (as the screen is not updating) when the MsgBox states:
All the data is entered into the cells. The application will update the screen when you press OK to see the data.


Reproducible: Always


User Profile Reset: No



Additional Info:
Attaching the ScreenUpdating.xls file in the next comment as unsure how to attach now.

Thank you
Comment 1 Óvári 2022-06-14 03:37:41 UTC
Created attachment 180744 [details]
ScreenUpdating.xls
Comment 2 Óvári 2022-06-14 03:40:33 UTC
On a device with a low powered CPU, the subroutine ScreenUpdateTestWorks() doesn't work either.
Comment 3 raal 2022-06-15 07:03:36 UTC
Confirm with Version: 7.4.0.0.beta1+ / LibreOffice Community
Build ID: fe3be12afd810e17427601178b5d186364bef8de
CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded Jumbo

and in Version: Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 4 Óvári 2022-06-20 00:12:33 UTC

*** This bug has been marked as a duplicate of bug 52603 ***