Ask Your Question

I need macro click help [closed]

asked 2018-10-31 18:19:37 +0200

Todd2 gravatar image

Hi All,


Can someone point me to an example or a how to of how to automate a series of clink functions (press this, press that, enter this, click that, etc.) with Macros?

Many thanks, -T

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by erAck
close date 2018-11-03 19:42:00.985742

2 Answers

Sort by » oldest newest most voted

answered 2018-11-03 06:40:23 +0200

Todd2 gravatar image

I wrote myself a test:

Sub GetCellValueTest
   Dim Sheet
   Dim D2
   Dim F5
   Dim C4
   Dim RtnCode As Integer

   rem assign a tab (sheet)
   Sheet = thiscomponent.sheets.getByName("Jump Log")

   rem get the position of "$D$2"
   D2 = Sheet.getCellRangeByName( "$D$2" )

   rem print oCell.value, oCell.string, oCell.formula, oCell.FormulaLocal, oCell.Error
   print D2.string, D2.value

   rem get the position of "$F$5"
   F5 = Sheet.getCellRangeByName("$F$5")

   rem write D2's string value to F5's position
   F5.setString( D2.string + " abc" )

   rem re-get "$F$2" after is hasw been overwritten
   F5 = Sheet.getCellRangeByName("$F$5")
   RtnCode = MsgBox( F5.string + "    ", 0, "Cell Value" )

   C4 =  Sheet.getCellRangeByName("$C$4")
   RtnCode = MsgBox( C4.string + "    ", 0, "Oh No!" )

End Sub
edit flag offensive delete link more

answered 2018-10-31 19:50:37 +0200

updated 2018-11-01 01:28:01 +0200 No password needed, just unlock, many buttons, formula's and simple macros. I learned much from reading questions here, and asking a few! For Blue Macro Button’s to work, or even to look at macro's, you will need to set macro’s at Medium, in Tools/Option, LibreOffice/Security..Macro Security.. Medium… (These Macro Buttons are safe) Then close the file, and reopen.

edit flag offensive delete link more


That has a lot of neat stuff in it. How do I read the contents of a cell?

Todd2 gravatar imageTodd2 ( 2018-11-03 06:31:06 +0200 )edit

Question Tools

1 follower


Asked: 2018-10-31 18:19:37 +0200

Seen: 42 times

Last updated: Nov 03 '18