I am trying to use cell values as the range to set a print area in a macro but without sucess.
e.g.
A1.value = 2
A2.value = 16
starting at C1
would make a print area of $C1$:$E$18
Got as far as below biut don’t know how to get the contents of A1 and A2 into the args2 value
sub test_print
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$Printer.$C$1:$E$18"
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:AddPrintArea", "", 0, Array())
end sub