Passing arguments to calc

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
gvanderschooten
Posts: 15
Joined: Sun Apr 20, 2008 6:45 pm
Location: France

Passing arguments to calc

Post by gvanderschooten »

Welcome beginner. Please answer all of the questions below which may provide information necessary to answer your question.
-----------------------------------------------------------------------------------------------------------
Which version of OpenOffice.org are you using? 2.3.1
What Operating System (version) are you using? windows XP SP2
What is your question or comment? Is there any way to pass an argument to calc, in order to get it from a vba macro. It could be done thru a shortcut in which one adds the argument to the command line (ie. the same way that you add the "-logo" argument)
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: passing arguments to calc

Post by TerryE »

gvanderschooten, sorry for the late reply but I am just sweeping through the unanswered posts. Have you worked out what you need to do here are do you still need help? In terms of using VBA to an OOo document you basically have two options:
  • The first is write your own macro in OOoBasic and let's say that you call this ProcessSheet and you put it in YourLibrary.Module1 then you start Soffice with the macro parameter "macro:///~YourLibrary.Module1.ProcessSheet(arg1, arg2, ...)". I use the Windows Scripting Host OCX as a reference simply because I find that the wshShell method Run gives me finer control here.
  • The second approach is to use COM automation bridge to talk to OOo directly just as you would talk to Word from an Excel app. Google the OPenOffice wiki to learn more.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
User avatar
gvanderschooten
Posts: 15
Joined: Sun Apr 20, 2008 6:45 pm
Location: France

Re: passing arguments to calc

Post by gvanderschooten »

Sorry..I was also very busy with other problems!
many thanks for your help. I'll resume working on that in August and will let you know about my "success".
G.Vanderschooten
User avatar
gvanderschooten
Posts: 15
Joined: Sun Apr 20, 2008 6:45 pm
Location: France

Re: passing arguments to calc

Post by gvanderschooten »

Solution 1 works fine for me. Thanks for your help.
Anyway, it could have been easier to have a "-parameter(arg1,arg,..)" argument with OOffice!But 'c'est la vie'
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: passing arguments to calc

Post by TerryE »

Glad to oblige :-)
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
Post Reply