Passing arguments to calc

Creating a macro - Writing a Script - Using the API

Passing arguments to calc

Postby gvanderschooten » Mon May 12, 2008 2:49 pm

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)
User avatar
gvanderschooten
 
Posts: 15
Joined: Sun Apr 20, 2008 6:45 pm
Location: France

Re: passing arguments to calc

Postby TerryE » Tue Jun 17, 2008 7:02 pm

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.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: passing arguments to calc

Postby gvanderschooten » Thu Jul 17, 2008 8:47 am

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

Postby gvanderschooten » Thu Aug 28, 2008 8:37 am

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'
User avatar
gvanderschooten
 
Posts: 15
Joined: Sun Apr 20, 2008 6:45 pm
Location: France

Re: passing arguments to calc

Postby TerryE » Thu Aug 28, 2008 5:24 pm

Glad to oblige :-)
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests