Bug 98546 - EDITING sheet links created using a macro are not updated immediately
Summary: EDITING sheet links created using a macro are not updated immediately
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, regression
Depends on:
Blocks: Calc-External-Datalink
  Show dependency treegraph
 
Reported: 2016-03-09 11:05 UTC by Jean-Francois Nifenecker
Modified: 2021-11-07 07:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Source data (11.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-09 11:06 UTC, Jean-Francois Nifenecker
Details
Target spreadsheet (day2.ods) (13.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-09 11:07 UTC, Jean-Francois Nifenecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Nifenecker 2016-03-09 11:05:45 UTC
Hi,
when setting a link to an external spreadsheet with a macro, the values returned aren't immediately taken into account. This causes any attempt to VLOOKUP() the linked values to fail. The linked values are only taken into account after saving and reopening the spreadsheet.

Tested under LO Version: 5.0.1.2
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale : fr-FR (fr_FR.UTF-8)

This was functioning correctly until v.4.3.7 and is buggy from the next version onwards, as some have reported on the FR libreoffice users mailing list.

I attach 2 files that help understand the problem: the user creates daily documents with data carried forward from day1 to day2 and so on. This is done using a macro, called from a button click.

day1.ods is the original data. The data to be carried forward is in the 'to carry' sheet.

day2.ods has the same structure + the macro that demonstrates the problem.
Clicking the 'Carry forward' button on the 'work' sheet causes a link to be established with the day1.ods document, 'to carry' sheet. This feeds the day2.ods 'carried' sheet. This is obtained with the ChargerReports() sub.

A workaround is to create a supplemental dummy sheet in the target (say 'carried2') where cells get their values from the 'carried' sheet. These 'carried2' values can be searched or used immediately. This adds complexity to the spreadsheet, though, and causes a noticeable overhead when the source data is big.

Note that deleting the link or not has no influence on the faulty behaviour.
Comment 1 Jean-Francois Nifenecker 2016-03-09 11:06:26 UTC
Created attachment 123423 [details]
Source data
Comment 2 Jean-Francois Nifenecker 2016-03-09 11:07:00 UTC
Created attachment 123424 [details]
Target spreadsheet (day2.ods)
Comment 3 Michel Rudelle 2016-03-09 15:13:54 UTC
I confirm this bug, tested under Vista-32b with:
- Version: 5.0.5.2
  Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3
  Locale : fr-FR (fr_FR)
- Version: 5.1.0.3
  Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
  Locale : fr-FR (fr_FR)
Comment 4 Jean-Francois Nifenecker 2016-03-09 15:56:33 UTC
(In reply to Jean-Francois Nifenecker from comment #0)
> 
> This was functioning correctly until v.4.3.7 and is buggy from the next
> version onwards, as some have reported on the FR libreoffice users mailing
> list.
> 

Please read:
This was functioning correctly until v.4.1.6.2 and is buggy from the next version onwards, as some have reported on the FR libreoffice users mailing list.

I unfortunately mixed both versions I'm currently working with on different platforms and computers.
Comment 5 Xisco Faulí 2017-09-29 08:53:46 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2018-05-25 11:54:24 UTC
Still repro.

Arch Linux 64-bit
Version: 6.1.0.0.alpha1+
Build ID: eeaf6dee2d278eaa037d95a756ad0ffab3314bc2
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on May 24th 2018
Comment 7 Buovjaga 2018-07-04 15:53:53 UTC
Bibisected on Ubuntu 14.04 with 42max. It had some launch crashes, so I had to skip several times. Fortunately it is a max repository, so has a very fine-grained group of commits.

I checked the "suspected bad commits" and this is what I found:
Kohei's big change: https://cgit.freedesktop.org/libreoffice/core/commit/?id=7333881bb7b04f7e4e2a28638024ae82a9c14e81
Formula tokens, formula cells and formula interpreters to use shared strings.

Kohei's related change committed at the same time: https://cgit.freedesktop.org/libreoffice/core/commit/?id=b3e35aa551fa8abc0215a0ef416fc9acbbc3c0d9
Fix VLOOKUP calculation when the matching value is literal string.

There was also this commit related to Calc external document references: https://cgit.freedesktop.org/libreoffice/core/commit/?id=d58d1719a49c5c25cce8ddfa7fef52b09d0f9957
Unused ScExternalRefCache::mrStrPool

Maybe the last one is improbably, but I thought I would mention it.
Comment 8 QA Administrators 2019-07-05 02:45:18 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2021-07-05 03:48:06 UTC Comment hidden (obsolete)
Comment 10 Jean-Francois Nifenecker 2021-11-07 07:49:27 UTC
Hi!
thanks for the fix. The problem is now solved. 

Tested under
Version: 7.1.3.2 / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: