I then have a button called "Reports" - when I click this I want the data to be displayed from the ListView/CSV file in OpenOffice Calc.
This is my code:
Private Sub cmdReports_Click() Dim oSM As Object Dim oDesk As Object Dim oDoc As Object Dim oSheet As Object Dim i As Integer 'Instanciate OOo : this line is mandatory with VB for OOo API Set oSM = CreateObject("com.sun.star.ServiceManage… 'Create the first and most important service Set oDesk = oSM.CreateInstance("com.sun.star.frame.D… 'Create a new doc Set oDoc = oDesk.loadComponentFromURL("private:fact… "_blank", _ 0, arg()) 'Get the first sheet in the doc Set oSheet = oDoc.getSheets().getByIndex(0) With oSheet For i = 1 To ListView1.ListItems.Count .cells(i, 1) = ListView1.ListItems(i).Text .cells(i, 2) = ListView1.ListItems(i).SubItems(1) .cells(i, 3) = ListView1.ListItems(i).SubItems(2) .cells(i, 4) = ListView1.ListItems(i).SubItems(3) Next End With End Sub
At the moment all my button is doing giving me Run-time error '438' Object does not support this property or method
When I debug this line is highlighted
.cells(i, 1) = ListView1.ListItems(i).Text
This code was written for Excel but I edited it so it can be displayed in OpenOffice Calc.
Can anyone help please?