Issue 120414 - can't run VBA macros from command line
Summary: can't run VBA macros from command line
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-30 21:42 UTC by pfeldman
Modified: 2013-12-26 11:17 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: 4.1.0-dev
Developer Difficulty: ---


Attachments
this file contains the above macro code (7.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-07-30 21:42 UTC, pfeldman
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description pfeldman 2012-07-30 21:42:16 UTC
Created attachment 78786 [details]
this file contains the above macro code

I've created an .ods file containing the following VBA macro:

   REM  *****  BASIC  *****

   Sub Main
   MsgBox("Hello")
   End Sub

I'm unable to run this macro from the command line. I've tried it on three
different computers running three different operating systems (Windows XP,
Windows 7, and Redhat Linux version 5.4).  The actual command that I'm issuing
follows:

   soffice "test1.ods" "macro://test1/Standard.Module1.Main()"

If macro security is turned on, I get a message that the macro cannot run
because of my macro security level.  If I turn off macro security, issuing the
above command causes the Calc application to open but does not cause the macro
to run.
Comment 1 pfeldman 2012-08-09 18:47:55 UTC
It would be great to have some response as to whether anyone is able to replicate this issue.
Comment 2 hanya 2012-08-10 02:25:36 UTC
Macro stored in the document should be specified as follows: 
soffice test1.ods macro://./Standard.Module1.Main()"
Comment 3 pfeldman 2012-08-10 15:35:27 UTC
There is a missing a quote; this should read as follows:

soffice test1.ods "macro://./Standard.Module1.Main()"

Thanks so much for responding!!

Phillip

P.S. It would be great if this were documented somewhere.
Comment 4 Edwin Sharp 2013-12-26 11:17:32 UTC
Per comment 3 - update help.