[Solved] Run Macro from Command Line?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Locked
A.C. Fairbanks
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm

[Solved] Run Macro from Command Line?

Post by A.C. Fairbanks »

Hello,

I am an OO macro newbie, and have a macro that I would like to run from the Command Line under Windows 10.

The macro is called RosterCheck and is in Basic. It appears in the OpenOffice Basic Macros dialog as My Macros | Standard | Module 1 | RosterCheck.

How can I launch the macro from the Command Line?

Many thanks,

A.C.
Last edited by Hagar Delest on Tue Apr 26, 2016 10:15 pm, edited 1 time in total.
Reason: tagged [Solved].
OOo 3.4.1 Win7
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Run Macro from Command Line?

Post by Zizi64 »

A batch file containing this two lines below works for me:

Code: Select all

cd c:\Program Files (x86)\OpenOffice 4\program\
soffice.exe -invisible "macro:///Standard.Module1.HelloWorld"
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.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.
A.C. Fairbanks
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm

Re: Run Macro from Command Line?

Post by A.C. Fairbanks »

Many thanks Tibor,

A.C.
OOo 3.4.1 Win7
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Run Macro from Command Line?

Post by RoryOF »

See Pitonyak's "Useful Macro Information for OpenOffice.org" section 5.31.2 and 5.32.2 for discussion and examples of running macros from the command line.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
A.C. Fairbanks
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm

Re: Run Macro from Command Line?

Post by A.C. Fairbanks »

Will do...

Many thanks,

A.C.
OOo 3.4.1 Win7
Locked