Libreoffice OpenofficeマクロでCalcファイルをエクセルxlsx形式で保存する方法です。下記のサイトにたどり着くまで1週間かかりました。現時点でグーグルで検索ヒットする日本語情報はありません。
https://bugs.documentfoundation.org/show_bug.cgi?id=99092
ポイントは
FilterNameを
Calc MS Excel 2007 XML
と設定するところです。
Option Explicit
Dim oDoc As Object
Dim oSheets As Object
Dim oSheet As Object
Dim oSheetName As String
oDoc = ThisComponent
oSheetName = "Sheet1"
oSheets = oDoc .getSheets()
oSheet = oSheets.getByName(oSheetName)
'------------------------
Dim DesktopPath As String
Dim wsh As Variant
Dim folderName As String
wsh = CreateObject("WScript.Shell")
folderName = "Desktop"
DesktopPath= wsh.SpecialFolders.Item(folderName)
'------------------------
Dim FileName As String
FileName = "test"
Dim path As String
path = ConvertToUrl(DesktopPath & "\" & FileName & ".xlsx" )
Dim mFileType(0) as new com.sun.star.beans.PropertyValue
mFileType(0).Name = "FilterName"
mFileType(0).Value="Calc MS Excel 2007 XML"
oDoc.StoreAsURL( path, mFileType())
oDoc.store()
oDoc.close(True)