Bug 155402 - FILEOPEN XLSX CELL() function gives different value compared to Excel with filename parameter
Summary: FILEOPEN XLSX CELL() function gives different value compared to Excel with fi...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Balázs Varga (allotropia)
URL: https://help.libreoffice.org/7.5/en-U...
Whiteboard: target:24.2.0 target:7.6.0.0.beta2
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2023-05-19 09:12 UTC by Gabor Kelemen (allotropia)
Modified: 2023-06-20 14:57 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (9.56 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-05-19 09:12 UTC, Gabor Kelemen (allotropia)
Details
The example file in Excel 2016 and Calc master (79.90 KB, image/png)
2023-05-19 09:13 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-05-19 09:12:59 UTC
Created attachment 187392 [details]
Example file from Excel

Attached document contains a CELL() function call with the "filename" infotype parameter. (also all other supported infotypes using attachment 187170 [details] as external example file, but focus only on this one here)

In Excel this gives a string in the driveletter:\<path>\[filename]Sheetname form, e.g

C:\Users\Gabor\Documents\[cell-function.xlsx]Sheet1

In Calc this is opened differently (and  as 

'file:///C:/Users/Gabor/Documents/cell-function.xlsx'#$Sheet1

It would be more interoperable to imitate the Excel-like behavior, at least in case of xlsx-files. See also bug 106151 which suggests introducing a CELL.XL function for interop purposes, starting with a different interop problem.

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: b3c88dc039d447322b8c8c564ab6e2f0ce9c5b90
CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

and back to 3.5
Comment 1 Gabor Kelemen (allotropia) 2023-05-19 09:13:33 UTC
Created attachment 187393 [details]
The example file in Excel 2016 and Calc master
Comment 2 Mike Kaganski 2023-05-19 09:42:43 UTC
Is it important to return the *file path* as opposed to *file URL* as the result, or is it important to only focus on using the Excel A1 syntax? These are two different targets. Excel can easily accept file URLs, and only needs the Excel A1 syntax to avoid errors, so IMO simply requiring that CELL function honored Options->Calc->Formula->Formula syntax, or maybe Detailed Calculation Settings->Custom->Reference syntax for string reference would already be interoperable.
Comment 3 Commit Notification 2023-06-17 14:00:04 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5c7196acbdd949005c1b52aeab34b5448e09011e

tdf#155402 - sc improving CELL() function return value in case of OOXML

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2023-06-20 14:57:34 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/6af0508592ea7d62e5452b88953c3aa7ddb0b281

tdf#155402 - sc improving CELL() function return value in case of OOXML

It will be available in 7.6.0.0.beta2.

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

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