how do I press "OK"?

Hi All,

I am running a macro to save a table as a png. I get a pop up for “PNG Options” → “Help”, “OK”, “Cancel”.

How do I press the “OK” button from the macro?

Many thanks,

edit: code as requested by gabix.

Public sub ExportTable( TableName As String )
   dim document   as object
   dim dispatcher as object
   dim MsgRtn     as Integer
   ' rem get access to the document
   document   = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("")

   dim args1(0) as new
   args1(0).Name = "Nr"
   args1(0).Value = 2

   dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())

   dim args2(0) as new
   args2(0).Name = "ToPoint"
   args2(0).Value = "$A$1:$I$21"

   dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())

   dim args3(3) as new
   args3(0).Name = "URL"
   args3(0).Value = "file:///" + TableName
   args3(0).Value = Replace( args3(0).Value, "\", "/" )
   MsgRtn = MsgBox( args3(0).Value, 0, "ExportTable" )
   args3(1).Name = "FilterName"
   args3(1).Value = "calc_png_Export"
   args3(2).Name = "FilterData"
   args3(2).Value = Array(Array("Compression",0,6,,Array("Interlaced",0,1,,Array("Translucent",0,1,,Array("PixelWidth",0,767,,Array("PixelHeight",0,748,,Array("LogicalWidth",0,20291,,Array("LogicalHeight",0,19788,
   args3(3).Name = "SelectionOnly"
   args3(3).Value = true

   dispatcher.executeDispatch(document, ".uno:ExportTo", "", 0, args3())
end sub

Read these guidelines and ask a good question. In particular, show the macro code.

Anyone? Is there a way to add “press the okay” into args3?