Hi guys,
I am triggering a save as dialog box from a macro in order to save a file as shown in the code below.
dim oFilePicker
dim docPath as String
dim sFilePickerArgs(0) as Integer
GlobalScope.BasicLibraries.loadLibrary("Tools")
sFilePickerArgs(0) = 10
oFilePicker = CreateUnoService( "com.sun.star.ui.dialogs.FilePicker" )
docPath = Tools.Strings.DirectoryNameoutofPath(ThisComponent.getURL(), "/")
With oFilePicker
.Initialize( sFilePickerArgs() )
.setDisplayDirectory( docPath )
.appendFilter("ODF Spreadsheet (.ods)", "*.ods" )
.setTitle( "Save As ..." )
End With
If oFilePicker.execute() = 1 Then
rem some code
End If
However the file is not getting saved as a new file as it does when clicking save as in the file menu. That is nothing happens. I am not sure what I am doing wrong here and I have been stuck with this for 2 days. It is very likely that I am making some careless error, or that I have missed out something very obvious. But I have been searching for a solution online for hours and I have no clue what is going wrong
I am using LO 6.3 on mac os 10.13.6.