Guest User

Macro1

a guest
Aug 2nd, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. sub Macro1
  2.     dim document   as Object
  3.     dim dispatcher as Object
  4.     dim st As String
  5.  
  6.     document   = ThisComponent.CurrentController.Frame
  7.     dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
  8.     dim args1(0) as new com.sun.star.beans.PropertyValue
  9.  
  10.     args1(0).Name = "ToPoint"
  11.     args1(0).Value = "$A$1"
  12.     dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
  13.  
  14.     my_cell = ThisComponent.Sheets(0).getCellByPosition(0,0)
  15.     st = my_cell.value + 1
  16.  
  17.     args1(0).Name = "StringName"
  18.     args1(0).Value = st
  19.     dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1())
  20. end sub
Advertisement
Add Comment
Please, Sign In to add comment