[Solved] Run Macro from Command Line?

Creating a macro - Writing a Script - Using the API

[Solved] Run Macro from Command Line?

Postby A.C. Fairbanks » Tue Apr 26, 2016 4:24 pm

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
A.C. Fairbanks
 
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm

Re: Run Macro from Command Line?

Postby Zizi64 » Tue Apr 26, 2016 6:05 pm

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

Code: Select all   Expand viewCollapse view
cd c:\Program Files (x86)\OpenOffice 4\program\
soffice.exe -invisible "macro:///Standard.Module1.HelloWorld"
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
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.
User avatar
Zizi64
Volunteer
 
Posts: 8543
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Run Macro from Command Line?

Postby A.C. Fairbanks » Tue Apr 26, 2016 6:25 pm

Many thanks Tibor,

A.C.
OOo 3.4.1 Win7
A.C. Fairbanks
 
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm

Re: Run Macro from Command Line?

Postby RoryOF » Tue Apr 26, 2016 6:30 pm

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.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29899
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Run Macro from Command Line?

Postby A.C. Fairbanks » Tue Apr 26, 2016 6:35 pm

Will do...

Many thanks,

A.C.
OOo 3.4.1 Win7
A.C. Fairbanks
 
Posts: 18
Joined: Sat Sep 15, 2012 3:53 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 9 guests