Hi,
I'm looking at Open Office (v4.1.5) and accessing Calc (=Excel) from VB. Specifically VB5 but I hope I can convert any suggestions made for VB.net, etc.
I've played around with a few things for a few days, checked online, nothing seems to work.
does anyone know how to 'Dim' and 'set' anything that can hold "com.sun.star.sheet.CellInsertMode.DOWN" so I can pass it to the Open Office Calc worksheet?
I've tried ("com.sun.star.sheet.CellInsertMode.DOWN"), still fails.
Regards
Peter
I'm looking at Open Office (v4.1.5) and accessing Calc (=Excel) from VB. Specifically VB5 but I hope I can convert any suggestions made for VB.net, etc.
I've played around with a few things for a few days, checked online, nothing seems to work.
Code:
Dim URL As String
Dim oSM As Object 'Root object for accessing OpenOffice from VB
Dim oDesk As Object 'Initial set up
Dim oDoc As Object 'initial set up
Dim OpenParam(1) As Object 'Parameters to open the doc
Dim oSheets As Object
Dim oSheet As Object
Dim oRange As Object
Dim oCRAddr As Object
Dim oCell As Object
Set oSM = CreateObject("com.sun.star.ServiceManager") 'initial set-up
Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
'Open Doc____________________________________________________
URL = "file:///D:/Open%20Office/test%201.csv"
Set oDoc = oDesk.loadComponentFromURL(URL, "_blank", 0, OpenParam) 'Open the Doc
Set oSheets = oDoc.getSheets() 'get available WorkSheets
Set oSheet = oDoc.sheets(0) 'point to 1st WorkSheet
'Cell Range for Insert________________________________________
Set oCRAddr = oSM.Bridge_GetStruct("com.sun.star.table.CellRangeAddress") 'Set Cell Range
oCRAddr.sheet = 0
oCRAddr.StartColumn = 1
oCRAddr.StartRow = 1
oCRAddr.EndColumn = 2
oCRAddr.EndRow = 2
'OK to here........................
'fails below on "com.sun.star.sheet.CellInsertMode.DOWN"
Call oSheet.insertCells(oCRAddr, "com.sun.star.sheet.CellInsertMode.DOWN")
'gives error 438 Object doesn't support this property or method
does anyone know how to 'Dim' and 'set' anything that can hold "com.sun.star.sheet.CellInsertMode.DOWN" so I can pass it to the Open Office Calc worksheet?
I've tried ("com.sun.star.sheet.CellInsertMode.DOWN"), still fails.
Regards
Peter