Gostaria de pegar a ComboBox1 que fica no Dialog1(FORMULARIO) e salvar ela na celula A2 da Planilha “Planilha2”.
Exemplo : TEM PLANILHA1 e PLANILHA2 no mesmo arquivo.
o codigo que eu estava usando.
Dim oDialog1 As Object
Sub DIGITAR1()
'oDialogo = CreateUnoDialog( DialogLibraries.Standard.getByName("Dialog1") )
    Dim cell_val
    dim document   as object
	dim dispatcher as object
    oT1 = oDialog1.GetControl("ComboBox1")
    'cell_val = ThisComponent.Sheets(2).getCellByPosition(0,2)
    
   ' msgbox cell_val.String & chr(13) & "Value from controls: "  & oT1.Text
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")   
   rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(2).Name = "ToPoint"
args1(2).Value = "$A$2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(2).Name = "StringName"
args2(2).Value = oT1.Text
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())
End Sub