You are not logged in.

Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "laloune" started this thread

Posts: 217

Date of registration: Dec 2nd 2009

Location: Berlin

Hobbies: Born to work :-)

  • Send private message

1

Thursday, June 14th 2012, 3:14pm

Get variable in a macro

Hi people,

I wonder how I can get a variable's value in a macro ?

I tried:

PHP Source code

1
2
// does not work
$myvariable=activesheet()->range("myvariable")->value;


PHP Source code

1
2
// does not work
$myvariable=retrieve_value("myvariable");


when I use a combobox and that target is a "ouptutVariable" variable, then the following works:

PHP Source code

1
$myvariable=retrieve_value("ouptutVariable");


any idea ?
laloune

"To understand recursion, one must understand recursion"

ethssn

Master

  • "ethssn" is male

Posts: 54

Date of registration: Feb 16th 2012

Location: Hamburg

Occupation: BI-Consultant

  • Send private message

2

Thursday, June 14th 2012, 4:03pm

I'm not a php programmer, but generally I'd think, if "myvariable" could contain >1 value (var with combobox -> selection of a consolidated element -> maybe it loads then also the children internally...?!?), it might be an array for php in turn, or point to one. Did you try to qualify more exact, which member of the potential myvariable-array you want to adress? Respectively, at which place inside of the range you want to place the var content, in case that the variable stores only one value?

But that is just a first idea, if useless: forget it ;-))

  • "laloune" started this thread

Posts: 217

Date of registration: Dec 2nd 2009

Location: Berlin

Hobbies: Born to work :-)

  • Send private message

3

Friday, June 15th 2012, 12:46pm

Hi ethssn and thanks for your response,

actually I found it in another thread: http://www.jedox.com/community/palo-foru…d&threadID=2406

the right syntax to do that is then ActiveWorkbook()->names->item('ouptutVariable')->value;

that makes sense (if I remember well it is simliar to Excel syntax)
laloune

"To understand recursion, one must understand recursion"

Similar threads

Rate this thread