Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MACRO Array

Hello everyone!

I wanted to know how to dynamically load an array via a macro.

CIAO!

Daniela

8 Replies
Not applicable
Author

you can simulate an array by loading to a table and using functions like fieldvalue.

Not applicable
Author

But this is not dynamic array but static!
I need dynamic! Huh?

Daniela

Not applicable
Author

Can you give an example of how you intend to use this array?

Not applicable
Author

Excuse my English .......... maybe I can not explain!

I want to dynamically load the list of objects in an array.

This is an array

bildArr = Array("CH112", "CH113", "CH123", "CH115", "CH144", "CH124", "CH125", "CH126", "CH127")



I want to make a macro that loads at runtime

Daniela [:'(]



Not applicable
Author

Try using this in your macro...

Objects = ActiveDocument.ActiveSheet.GetSheetObjects
For i = lBound(Objects) To uBound(Objects)

.... do something ....

next

Not applicable
Author

OK!
But with that education is the loading of the array???

Daniela[:'(]

Not applicable
Author


Daniela wrote:
But this is not dynamic array but static!
I need dynamic! Huh?
Daniela<div></div>


sorry...I got confused with the "dynamically load an array" part.

a couple of questions: what values do you want to load in your array and when will you be reloading/resizing it?

Not applicable
Author

Quote: "But with that education is the loading of the array???"

Sorry, this lost something in the translation.

The 'Objects' in the code that I posted above is the array, and this gets loaded when the macro runs. You can set macros to run on various events (such as opening the document) or to run from a button. It will be dynamic in the sense that it will be recreated when the macro runs - it will hold all objects on the active sheet (as I have quoted it), and if you add another object that will be included next time the macro runs.

Perhaps you could create a QlikView document and load it to the Forum. If you point out what works and what you still need to do, there are people that can 'fix' it and post back the answer.