Bug 158857 - Keep Power Query when saving XLSX
Summary: Keep Power Query when saving XLSX
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Bayram Çiçek
URL:
Whiteboard: target:25.2.0 inReleaseNotes:25.2
Keywords: filter:xlsx
Depends on:
Blocks: Cell-Formula XLSX
  Show dependency treegraph
 
Reported: 2023-12-25 15:10 UTC by Timur
Modified: 2025-05-24 21:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Power query XLSX (118.73 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-12-25 15:10 UTC, Timur
Details
xlsx file original (excel) (447.71 KB, image/png)
2024-01-25 23:26 UTC, Bayram Çiçek
Details
xlsx file saved in calc (454.63 KB, image/png)
2024-01-25 23:33 UTC, Bayram Çiçek
Details
LO retains connections.xml but modified (163.16 KB, image/png)
2025-05-07 22:30 UTC, Piotr Osada
Details
LO don't handle 'queryTable*.xml' (224.53 KB, image/png)
2025-05-07 22:37 UTC, Piotr Osada
Details
XLSX examples, 'connections.xml' and 'queryTables' (471.94 KB, application/x-zip-compressed)
2025-05-07 22:42 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2023-12-25 15:10:21 UTC
Created attachment 191591 [details]
Power query XLSX

MSO supports Power Query [1].
Example of XLSX with Power Query set is attached, taken from [2].

When such XLSX is resaved in LO, MSO does not recognize query. 
So it is data loss.
If data od query is not changed, LO should keep it so that MSO opens it. 

https://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a
https://www.ablebits.com/office-addins-blog/how-to-use-power-query-excel/
Comment 1 m_a_riosv 2023-12-25 17:35:10 UTC
As Calc does not have it implemented, it is probably not even imported.

But you are right that it would be nice if it was preserved when opening/saving.

It seems to me more like a request for enhancement than a bug.

+1
Comment 2 Bayram Çiçek 2024-01-25 23:26:15 UTC
Created attachment 192173 [details]
xlsx file original (excel)

original file with power query on Win10 / Excel.
Comment 3 Bayram Çiçek 2024-01-25 23:33:20 UTC
Created attachment 192174 [details]
xlsx file saved in calc

xlsx file that saved in calc then opened in excel.

Power query is not recognized. There is nothing under the 'Queries & Connections' tab.
Comment 4 Bayram Çiçek 2024-06-06 10:36:17 UTC
164290: (WIP) tdf#158857: Keep Power Query when saving XLSX | https://gerrit.libreoffice.org/c/core/+/164290
Comment 5 Commit Notification 2024-07-09 08:17:31 UTC
Bayram Çiçek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/045ebdb369ab21a3be7a32dc1c85ad2243eb9129

tdf#158857: [Power Query] export connections.xml

It will be available in 25.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 6 Commit Notification 2024-08-16 15:05:54 UTC
Bayram Çiçek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f91d74da5571b877126f4f753c4134054fa606bb

tdf#158857: [Power Query] export xl/drawings/drawing*.xml

It will be available in 25.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 7 Piotr Osada 2025-05-07 22:30:07 UTC
Created attachment 200695 [details]
LO retains connections.xml but modified

(In reply to Commit Notification from comment #5)
> Bayram Çiçek committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 045ebdb369ab21a3be7a32dc1c85ad2243eb9129
> 
> tdf#158857: [Power Query] export connections.xml
> 
> It will be available in 25.2.0.

Confimr, now LO handles (saves) connections.xml

Verified in:
Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

But is this "a right behavior" to modify content of this file, since as now LibreOffice does not have any Pover Query equivalent?
Comment 8 Piotr Osada 2025-05-07 22:37:25 UTC
Created attachment 200696 [details]
LO don't handle 'queryTable*.xml'

Follow-up:

LO can't handle /xl/queryTables/queryTable1.xml ... files.
This folder is not saved into OOXML.

Checked in:
Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ba521b1d33f629fb448086a3ac052d8a633d6cbf
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 9 Piotr Osada 2025-05-07 22:42:24 UTC
Created attachment 200697 [details]
XLSX examples, 'connections.xml' and 'queryTables'

Source files relating to situations in:
comment 7
and 
comment 8