I'm trying to insert a cell beginning with the first cell in a range (via the .getCellRangeByName() method of a Document's active Sheet).
I found out how to do this with a Dispatcher from the OpenOffice library (.uno:InsertCell), but I'd prefer to use something that doesn't require the dispatcher if possible.
Example code that I plan to wire-up to a button...
Sub AddManualBalance(EntryDate As Date, EntryAmount As Currency)
Dim Doc As Object
Dim Sheet As Object
Doc = ThisComponent
If Doc Is Nothing Then
Return
EndIf
Sheet = Doc.getCurrentController().getActiveSheet()
If Sheet Is Nothing Then
Return
EndIf
Dim TargetCells As Object
TargetCells = Sheet.getCellRangeByName("B9:C9");
// insert a cell in both the B and C columns at position 9,
// then move all other cells down
// add my EntryDate as a value to the new cell in B column
// add my EntryAmount as a value to the new cell in C column
End Sub
Thanks in advance for any help!
P.S. I really dislike Basic, but it seems that with spreadsheets and office app automation, that's the preferred language. Is there any way to do LibreOffice/OpenOffice macros in a more C-like language?