Near as I can tell, the way to do this is with a macro. I've tried
following several guides but it isn't working. What I want is really
simple: Select a shortcut (say F3) and have my spreadsheet respond as
though I had pressed four keys, F2 to start editing a cell, HOME to
position my cursor at the start of the cell, DEL to delete the first
character in the cell, ENTER to finish editing. But when I tried to
record this macro, nothing happened until I selected a cell. Then when
I tried to run the macro, the current cell was changed to contain what
the cell contained where recording was performed. What am I doing wrong?
I've looked at the macro code generated and don't see anything related
to what I want. I'd try to fix it but have no clue what to change. Here's
the macro which was recorded.
sub Neg
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$E$4"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SetInputMode", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "StringName"
args3(0).Value = "132"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args3())
end sub
Yeah, E4 was the cell where I tried recording and its value at that time
was 132. But I don't want to always do this only on that cell and I don't
want the result to always be 132.
--
Dave Close, Compata, Irvine CA +1 714 434 7359
[email protected] [email protected]
"Punctuality is the virtue of the bored." -- Evelyn Waugh
--
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy