I wrote a script using FileOpen dialog, and wanted to use multiselection. It worked out on XP, but does not on Win7/64bit.
I can not see the reason.
The behaviour is: dialog opens, but does not allow multiselect at all, only single. Even I set '.setMultiSelectionMode(True)'.
[Solved] FileOpenDialog multiselect does not work on Win7
[Solved] FileOpenDialog multiselect does not work on Win7
Last edited by Hagar Delest on Tue Jun 13, 2017 8:03 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.1.3 on Windows 7 64bit
Re: VBA FileOpenDialog multiselect does not work on Win7
We need to see the code involved.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: VBA FileOpenDialog multiselect does not work on Win7
Code: Select all
Function OpenFileDialogKep(byRef files() as String) as Integer
Dim oFilePicker As Object
Dim sFiles As Object
REM file dialog
oFilePicker = CreateUnoService( "com.sun.star.ui.dialogs.FilePicker" )
REM set filter
oFilePicker.AppendFilter( "All files (*.*)", "*.*" )
oFilePicker.AppendFilter( "Opera kiíró KEP fájl", "*.KEP" )
oFilePicker.AppendFilter( "Opera kiíró TXT fájl", "*.TXT" )
oFilePicker.SetCurrentFilter( "Opera kiíró KEP fájl" )
'oFilePicker.setDefaultName(defaultname)
oFilePicker.setTitle("Kép fájl megnyitása")
oFilePicker.setMultiSelectionMode(True)
If oFilePicker.execute() Then
sFiles = oFilePicker.getFiles()
If Ubound(sFiles) = 0 Then
ReDim Preserve files(2)
files(0) = DirectoryNameoutofPath(sFiles(0), "/")
files(1) = FileNameoutofPath(sFiles(0), "/")
OpenFileDialogKep = 1
Else
ReDim Preserve files(Ubound(sFiles))
For i = 0 to Ubound(sFiles())
files(i) = sFiles(i)
Next i
OpenFileDialogKep = Ubound(sFiles())
End If
Else
OpenFileDialogKep = 0
End If
End Function
Sorry, I found that, I use AOO 4.1.3 under Win7, and AOO 4.1.2 under XP. Might it be a difference?
OpenOffice 4.1.3 on Windows 7 64bit
Re: VBA FileOpenDialog multiselect does not work on Win7
There is discussion on a similar topic at
viewtopic.php?f=20&t=79058
viewtopic.php?f=20&t=79058
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: VBA FileOpenDialog multiselect does not work on Win7
Thank you for the information. I read the thread, and it is not similar...
I can get data out from open dialog. And the same script works well under XP.
But it does not work well under Win7/64
The difference is: file open dialog pops up, I can see the file list, but I am not able to select more than one file.
I tried to move cursor over multiple names during mouse button pressed, as usual. Only one file is selected.
I also tried to used SHFT+arrows, with same result.
And I updated AOO from 4.1.2 to 4.1.3 under XP, script works well under newer version of AOO too.
But not under Win7/64.
I can get data out from open dialog. And the same script works well under XP.
But it does not work well under Win7/64
The difference is: file open dialog pops up, I can see the file list, but I am not able to select more than one file.
I tried to move cursor over multiple names during mouse button pressed, as usual. Only one file is selected.
I also tried to used SHFT+arrows, with same result.
And I updated AOO from 4.1.2 to 4.1.3 under XP, script works well under newer version of AOO too.
But not under Win7/64.
OpenOffice 4.1.3 on Windows 7 64bit
Re: VBA FileOpenDialog multiselect does not work on Win7
On a Linux/Gnome system I can select multiple files in the system file picker but the returned array contains only one element. Seems to be a bug.
The problem does not show up when you use the native office file picker (Tools>Options>General>Use Office dialog boxes)
Similar problem: viewtopic.php?f=20&t=86403&p=403950&hil ... er#p403938
The problem does not show up when you use the native office file picker (Tools>Options>General>Use Office dialog boxes)
Similar problem: viewtopic.php?f=20&t=86403&p=403950&hil ... er#p403938
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: VBA FileOpenDialog multiselect does not work on Win7
I can not write more clear...
The same script does everithing right under XP.
But I am not able to select more than one file in file opening dialog under Win7.
So, nothing to do with how to pass data, like filenames from file open dialog.
The same script does everithing right under XP.
But I am not able to select more than one file in file opening dialog under Win7.
So, nothing to do with how to pass data, like filenames from file open dialog.
OpenOffice 4.1.3 on Windows 7 64bit
Re: VBA FileOpenDialog multiselect does not work on Win7
It has something to do with modern tool kits and old ones.
Recent Gnome fails
Recent Windows fails
XP works
Native AOO works
The last one can be switched on in any case. At least it works with AOO 4.1.3 on Linux where it fails with the Gnome tool kit.
LibreOffice has modified the file picker service.
It provides getSelectedFiles() with one full URL per selected file. This works with native LO dialogs and the Windows 10 tool kit as well.
I doubt this will ever be fixed in AOO since AOO is not under active development anymore.
Recent Gnome fails
Recent Windows fails
XP works
Native AOO works
The last one can be switched on in any case. At least it works with AOO 4.1.3 on Linux where it fails with the Gnome tool kit.
LibreOffice has modified the file picker service.
It provides getSelectedFiles() with one full URL per selected file. This works with native LO dialogs and the Windows 10 tool kit as well.
I doubt this will ever be fixed in AOO since AOO is not under active development anymore.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: VBA FileOpenDialog multiselect does not work on Win7
Villeroy
I just tried to change, wich fileopen dialog should be used based on your previous post.
It does help.
Thank you
I just tried to change, wich fileopen dialog should be used based on your previous post.
It does help.
Thank you
OpenOffice 4.1.3 on Windows 7 64bit