Visual basic to calc

method for exporting data from Visual basic to libreoffice calc format.

right now we are using Set objExcel = CreateObject(“excel.application”) for msoffice output, we want it to libreoffice format.


If this statement means to create a new empty Excel file, then the equivalent in LibreOffice BASIC is

sURL = "private:factory/scalc"

objCalc = StarDesktop.loadComponentFromURL(sURL, "_blank", 0, Array())

It will create an empty Calc file, acessible by objCalc object.

I have a complete code here.

Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oApp As Excel.Application
oExcel = CreateObject("Excel.Application")
oApp = GetObject(, "Excel.Application")
oBook = oExcel.Workbooks.Add(Type.Missing)
oSheet = oBook.Worksheets(1)

How do you do this for Libre Office Calcu??