Bug 118441 - VBA macro unnecessarily recalculated
Summary: VBA macro unnecessarily recalculated
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.2.0 target:6.1.0.1
Keywords: implementationError, perf
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2018-06-28 23:18 UTC by Aron Budea
Modified: 2018-07-03 09:59 UTC (History)
0 users

See Also:
Crash report or crash signature:
Regression By:


Attachments
Sample XLSM (80.24 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2018-06-28 23:18 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-06-28 23:18:20 UTC
Created attachment 143195 [details]
Sample XLSM

The attached XLSM spreadsheet contains 7000 rows with a simple summation macro (sums values in B-Z columns, which aren't filled, so the result is always 0).
In Excel the file opens in ~1s.

In Calc it opens in ~23s.

If macros are disabled, rows 2-7000 show #VALUE! error, which means those are the ones being calculated, when they shouldn't.

Observed using LO 6.1 beta2 / Windows 7.
Comment 1 Aron Budea 2018-06-29 00:15:15 UTC
Already opens slowly in 4.3.0.4, and in 4.2.0.4 the macro isn't executed at all. => implementation error
Comment 2 Mike Kaganski 2018-06-29 00:35:28 UTC
Confirmed that both using "Never recalculate" and "Always recalculate" for "Recalculation on file load"->"Excel 2007 and newer", the opening time is ~same long (with recalculation), while it should be much shorter for the "Never recalculate" case.

Tested with Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: ru-RU (ru_RU); Calc: CL
Comment 3 Mike Kaganski 2018-06-29 11:22:19 UTC
https://gerrit.libreoffice.org/56675
Comment 4 Commit Notification 2018-06-29 15:12:03 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e6c43ed9e6bb41b64bcc8105ad006c999deebcd7

tdf#118441: also keep string-formula results for shared formulas

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2018-07-03 09:59:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee0d0b0d21889441dec04c3b17fc99087cf8ef96&h=libreoffice-6-1

tdf#118441: also keep string-formula results for shared formulas

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.