General:
1. Never post something in the "Macros ..." sub-forum without telling the language you are using and the module of "our" software (in this case Calc) the macro is made for.
2. If you post code, give a sufficiently complete part of it.
3. Best attach an example file containing the code you are asking about.
4. Be aware of the fact that .uno: commands use their own naming and syntax.
5. If you want to use .uno: commands in a written/edited macro, start your work based on a recorded example. It often can tell you much about the usage.
Specific:
The number of steps in .uno:GoUp is not named "Count" but "By".
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
sub GoupTest
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(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 10
args1(1).Name = "Sel"
args1(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args1())
End Sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
5. If you want to use .uno: commands in a written/edited macro, start your work based on a recorded example. It often can tell you much about the usage.
My addition:
Record (do not write) the recordable macros. Then you can modify them - if it is needed.
But it is better to WRITE the macros based on the API functions. It is a more effective method to control the application and the documents even if the document is in Hidden state.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
First of all, I would like to apologize for not being clear enough about the problem and the scenario.
First, I'm currently using JAVA to execute .uno: commands via executeDispatch.
Second, what you said about the LO/OO BASIC script is also correct when it runs in my environment.
Finally, I would like to reiterate the problem I am currently experiencing. I'm having trouble executing the .uno:GoUp command in JAVA. When I control the execution behavior of the command through the "Count/By" property, it does not have the expected effect, and only one line of text is always selected upwards after the command is executed, but in BASIC, this property does take effect.
And as I said, I'm having trouble executing .uno:GoUp commands in the way I use the API. So I wanted to do this by using JAVA to control LO to execute BASIC scripts, but I found that I couldn't execute BASIC scripts correctly in documents opened in hidden mode (which works in visible mode), and I'm discussing this in this topic viewtopic.php?p=544614#p544614.