libreOffice calc automation

HI,

Ive cobbled together the following code to write out a spreadsheet.
It works, but i cannot see how to make the sheet refresh. All the columns are sort of jumbled up in column A.
If i double click the header border, it autofits all the columns.

does anyone know how to make it refresh?

[code]Dim objServiceManager As OLEObject
Dim objCoreReflection As OLEObject
Dim objDesktop As OLEObject
Dim objDocument As OLEObject
Dim SaveParams(0) as OLEObject
Dim sheets as OLEObject
Dim sheet as OLEObject
Dim saveparam as OLEObject
Dim args() As variant

objServiceManager = New OLEObject(“com.sun.star.ServiceManager”)
objCoreReflection = objServiceManager.createInstance(“com.sun.star.reflection.CoreReflection”)
objDesktop = objServiceManager.createInstance(“com.sun.star.frame.Desktop”)

objDocument= objDesktop.loadComponentFromURL(“private:factory/scalc”, “_blank”, 0, args)
Sheets = objDocument.getSheets()
Sheet = Sheets.getByIndex(0)
Sheet.getCellByPosition(0, 0).SetFormula(“Table Title”)

For col as integer = 0 To 9
Sheet.getCellByPosition(col, 1).SetFormula("Column " + str(col+1))
For row as integer = 0 To 9
Sheet.getCellByPosition(col, row+2).Value = col + row
Next
next

SaveParam = objServiceManager.Bridge_GetStruct(“com.sun.star.beans.PropertyValue”)
SaveParam.Name = “FilterName”
SaveParam.Value = “MS Excel 97”

saveparams(0) = SaveParam
objDocument.storeToURL “file:///c:/test/test.xls”, saveparams[/code]

It works perfect on my computer with RealStudio 2012r2.1 or Xojo 2013r4.1 and Libreoffice 5.2.1.2 . All cells/columns are shown first time when I run your program

hmm. thanks for your info. interesting!

Ive noticed that the save dialog on LibreOffice is blacked out until i move my mouse over it and then just the buttons show up.

Im running Windows 10 / Xojo 2016r3 in VmWare Fusion on my mac. I wonder if the issue is LibreOffice on the VM?

I will have to test it on some other (real) machines.

Try reinstall LibreOffice. I did another test on my other Computer running Windows 7 Xojo 2016R3 and Libreoffice 5.2.2. That works fine too.