We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Is there a Macro means to complete an active cell edit?

asked 2020-02-20 17:47:23 +0200

OldEng gravatar image

The user enters value into cell $C$3 (for example) then activates a macro by means of a button event. If the user did not deselect the active cell before the button event then the data edit for $C$3 is still in process and the macro will not see the user's value. So the question is whether there is a means via the macro to force the cell edit action to completion? I've tried oSheet = ThisComponent.Sheets.getByName("TheSheet") : oCell = oSheet.getCellByPosition(0,0) : oCell = " " without success. Evidently macro cell references do not work exactly the same as active sheet cell selection.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-02-20 20:23:31 +0200

OldEng gravatar image

Hi all. I have discovered a means to change the FOCUS to the 0,0 cell. Here it is: Sub uSelectHome dim document as object dim dispatcher as object dim args1(0) as new com.sun.star.beans.PropertyValue

document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") args1(0).Name = "ToPoint" args1(0).Value = "$A$1" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) End Sub

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-02-20 17:47:23 +0200

Seen: 52 times

Last updated: Feb 20 '20