Bug 170432 - FILESAVE: XLS -> XLSX Import of external functions
Summary: FILESAVE: XLS -> XLSX Import of external functions
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.8.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Karthik
URL:
Whiteboard: target:26.8.0 target:26.2.2
Keywords:
Depends on:
Blocks: XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2026-01-22 10:45 UTC by Karthik
Modified: 2026-02-26 16:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
XLS File (107.00 KB, application/vnd.ms-excel)
2026-01-22 10:45 UTC, Karthik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karthik 2026-01-22 10:45:07 UTC
Description:
Open the attached XLS file and save it as XLSX, Excel throws an error when opening the resulting file.

The XLS file contains external functions. Open the original file in Excel and look at the cell D32, we see a function `percent(B32,B$31)`. When we open same file in LibreOffice and look at cell D32 we see `(#NAME?, B32, B$31)`.

So, when we export to XLSX we export this invalid external function which Excel doesn't accept

Steps to Reproduce:
1. Open the attached XLS File
2. Save it as XLSX
3. Open the resulting file Excel

Actual Results:
Excel throws an error when opening the file

Expected Results:
Excel opens the file without any problem


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 22; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 1 Karthik 2026-01-22 10:45:33 UTC
Created attachment 205124 [details]
XLS File
Comment 2 m_a_riosv 2026-01-22 12:14:02 UTC
It is also an error opening with
Microsoft® Excel® para Microsoft 365 MSO (versión 2511 compilación 16.0.19426.20218) de 64 bits 
Saving in Excel as XLSX doesn't solve the issue.
Comment 3 Karthik 2026-01-23 06:08:09 UTC
I didn't notice that even Excel fails to open the file saved in Excel as XLSX :). Anyways I have a patch to properly import External functions, with this the resulting XLSX saved in LibreOffice opens in Excel without any problem.

https://gerrit.libreoffice.org/c/core/+/197535
Comment 4 Commit Notification 2026-02-16 00:13:44 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "master":

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

tdf#170432: Import unknown functions as externals

It will be available in 26.8.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 5 Commit Notification 2026-02-26 16:21:04 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/88ba1197d83543de7783f531ad705e1352374539

tdf#170432: Import unknown functions as externals

It will be available in 26.2.2.

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.