LibreOffice CalcのVBでドキュメントの新規追加・編集・保存・閉じる

Dim document As Object

document = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, Array())
'document = StarDesktop.loadComponentFromURL(ConvertToUrl("C:\Users\hiro\Desktop\test.ods"), "_blank", 0, Array())

Dim sheet As Object
sheet = document.CurrentController.ActiveSheet
sheet.getCellByPosition(4, 4).setValue 2

document.storeAsURL(ConvertToUrl("C:\Users\user\Desktop\test.ods"), Array())

document.dispose
カテゴリーCalc