In my Calc-file I have the basic macro:
Sub sMySub
msgbox "hello"
End Sub
I tried following lines in the XP - command window while in the map "C:\Program Files\OpenOffice.org 3\program>"
soffice.exe "macro:///Standard.Module1.sMySub"
soffice.exe "macro:///[My File.ods].Standard.Module1.sMySub"
soffice.exe "C:\My Documents\My File.ODS" "macro:///Standard.Module1.sMySub"
soffice.exe "C:\My Documents\My File.ODS" "macro:///[My File.ods].Standard.Module1.sMySub"
soffice.exe "C:\My Documents\My File.ODS" "macro:///My File.ods.Standard.Module1.sMySub"
Nothing works except switching the active window to my already running "My File.ods" with the last 3 examples above...
What am I doing wrong?
[Solved] Can't execute macro in file.ods from command line
[Solved] Can't execute macro in file.ods from command line
Last edited by onidarbe on Sun May 24, 2009 10:24 pm, edited 1 time in total.
OOo 3.1.X on Ms Windows XP
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: Can't execute oobasic-macro in file.ods from command line
Hi,
And avoid using spaces and national characters in the file name.
______
Bernard
Code: Select all
soffice.exe "C:\My Documents\MyFile.ODS" "macro://MyFile/Standard.Module1.sMySub"
______
Bernard
Re: Can't execute oobasic-macro in file.ods from command line
Thank you B Marcelly, I've spend hours looking for this and it's so obvious
It even works with spaces in the name
It even works with spaces in the name
OOo 3.1.X on Ms Windows XP
-
- Posts: 46
- Joined: Wed Nov 19, 2008 7:54 pm
Re: [Solved] Can't execute macro in file.ods from command line
Hi,
Is it then possible to run a OO macro within a file "test123.ods", without opening the file? or even without getting a message for "ENABLE MACROS"?
I could run a macro through command line, but i dont want calc file to open.
Any way o do it?
Abhi
Is it then possible to run a OO macro within a file "test123.ods", without opening the file? or even without getting a message for "ENABLE MACROS"?
I could run a macro through command line, but i dont want calc file to open.
Any way o do it?
Abhi
OOo 2.3.X on Ms Windows XP
Re: [Solved] Can't execute macro in file.ods from command li
Code: Select all
"c:\Program Files (x86)\OpenOffice 4\program\soffice.exe" -invisible "macro:///Standard.Module1.Main"
AOO 4.1.4 (Polish) on Windows 10 (64b) / AOO 4.1.0 on Windows Vista / (LibreOffice on Mageia Linux)