Page 1 of 1

Passing arguments to calc

PostPosted: Mon May 12, 2008 2:49 pm
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)

Re: passing arguments to calc

PostPosted: Tue Jun 17, 2008 7:02 pm
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.

Re: passing arguments to calc

PostPosted: Thu Jul 17, 2008 8:47 am
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

Re: passing arguments to calc

PostPosted: Thu Aug 28, 2008 8:37 am
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'

Re: passing arguments to calc

PostPosted: Thu Aug 28, 2008 5:24 pm
by TerryE
Glad to oblige :-)