Bug 118246 - FILEOPEN XLSX Basic code with “GetOpenFilename” method does not work
Summary: FILEOPEN XLSX Basic code with “GetOpenFilename” method does not work
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords:
: 126750 (view as bug list)
Depends on:
Blocks: Macro-VBA-Error423
  Show dependency treegraph
 
Reported: 2018-06-19 16:18 UTC by Gabor Kelemen (allotropia)
Modified: 2024-09-23 03:15 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (20.50 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2018-06-19 16:18 UTC, Gabor Kelemen (allotropia)
Details
The macro in Excel and Calc side by side (353.75 KB, image/png)
2018-06-19 16:22 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) 2018-06-19 16:18:08 UTC
Created attachment 142930 [details]
Example file from Excel

If we try to run this simple “open file dialog” macro in LibreOffice Calc, which is in the attached file, we got an error code('423' GetOpenFilename). The main reason of this error is that LibreOffice uses another File selection dialog method: CreateUnoService("com.sun.star.ui.dialogs.FilePicker")

Steps to reproduce:
1. Create a new spreadsheet with Microsoft Excel 2016/2013
2. Open the Visual Basic window
3. Add a new Module to your VBAProject
4. Use this simple code:
Sub getFileName()
Dim filename As String
filename = Application.GetOpenFilename()
MsgBox filename
End Sub
5. Save the file as *.xlsm
7. Open the file with LibreOffice Calc. Run the macro.

Actual results: The file dialog is opened in Microsoft Office Excel, but If We use this “GetOpenFilename” method in LibreOffice Calc, we get an error message. If we use the LibreOffice module CreateUnoService("com.sun.star.ui.dialogs.FilePicker") we don’t gt an error message.

Expected results:
We should not get an error message if we use the “GetOpenFilename” method.


Version: 6.0.0.0.beta1+
Build ID: 29228e83df009cf76ac819ed024527be1092f065
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2017-12-04_23:15:34
Locale: hu-HU (hu_HU); Calc: group threaded
Comment 1 Gabor Kelemen (allotropia) 2018-06-19 16:22:39 UTC
Created attachment 142931 [details]
The macro in Excel and Calc side by side
Comment 2 himajin100000 2018-06-19 17:01:43 UTC
The problem is not in FilePicker. the responsibility is on ScVbaApplication. This class currently does not have GetOpenFilename() method.

https://opengrok.libreoffice.org/more/core/sc/source/ui/vba/vbaapplication.cxx?q=ScVbaApplication
Comment 3 Buovjaga 2018-06-24 18:52:54 UTC
NEW per comment 2
Comment 5 raal 2021-10-02 14:18:52 UTC
*** Bug 126750 has been marked as a duplicate of this bug. ***
Comment 6 Commit Notification 2022-01-22 00:39:42 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/571438a34ad9aba0d496a89e8345851331740fbd

tdf#118246 add support for Application.GetOpenFilename func.

It will be available in 7.4.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 Justin L 2022-09-23 21:27:59 UTC
Is this fixed now?
Comment 8 QA Administrators 2024-09-23 03:15:37 UTC
Dear Gabor Kelemen (allotropia),

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug