Could anyone assist in being able to use Absolute References when using macros’s?
I need to insert a new Column into a sheet and populate this with a formulae. EG if we have
COL1 COL2 COL 3
I wish to insert a new Column (COL1.1) to the left of COL2, irrespective of where the Active cell is currently.
Below is the macro recorded, but will only insert a column relative to where the cursor is currently on the sheet.
sub TEST_INSERT_C
rem define variables
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem dispatcher.executeDispatch(document, ".uno:ToggleRelative", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:InsertColumnsBefore", "", 0, Array())
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = "$C$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "StringName"
args4(0).Value = "Test Member Value"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args4())
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
end sub
Any suggestions would be appreciated
Cheers
(Edited for better readability by @Lupp )