Como acertar esta Macro com sub-rotina ?
sub Executar
rem ===> ir para planilha 1 celula c5
IrParaCelula 1, "$c$5"
end sub
sub IrParaCelula ( x as integer, y as string) rem <=== como definir aqui ?
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 args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Nr"
args1(0).Value = x rem <=== x é o numero da planilha
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = y rem <==== y é a célula
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
end sub