Ask Your Question

visual basic to calc [closed]

asked 2012-02-18 12:39:01 +0200

Dhaval gravatar image

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.

Regards, Dhaval

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-28 22:01:24.405918

2 Answers

Sort by » oldest newest most voted

answered 2012-02-28 20:09:42 +0200

Olivier gravatar image

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.

edit flag offensive delete link more

answered 2014-07-08 03:52:29 +0200

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??

edit flag offensive delete link more

Question Tools


Asked: 2012-02-18 12:39:01 +0200

Seen: 4,707 times

Last updated: Jul 08 '14