Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calling macro Function in BackEnd

Hi Guys

i have written a following Macro Function

Function CountNumberOfRows()

Set Sheet = ActiveDocument.GetSheetObject("CH01")

Rows = Sheet.GetNoOfRows

CountNumberOfRows = Rows

End Function

Now i m calling the above Macro Function in backend Like as below :

Let v = CountNumberOfRows();

But the variable v is not not getting any value.....

Please help 

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Just an example. You'll have to modify it to your needs yourself:

 

Sub GetIDs

Objects = ActiveDocument.ActiveSheet.GetSheetObjects
For i = lBound(Objects) To uBound(Objects)
    id = Objects(i).GetObjectId
    msgbox("ID = " & id)
next

end sub


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

You can't access UI objects in the script, i.e. during reloads. So the macro can't get the number of rows.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert

thanks for the reply

Can you tell how to access the Sheetobjectid of the objects in each sheet.

I want the Id of the Charts in a sheet

Gysbert_Wassenaar

You can access them with a macro like you posted. But the macro only works in the UI, in interactive mode. It won't work when you call the macro in the load script.


talk is cheap, supply exceeds demand
Not applicable
Author

no..actually i want the id of the sheet objects in a particular sheet. for example if  have 3 straight table in Sheet 1 then i want CH01,CH02,CH03

Gysbert_Wassenaar

Just an example. You'll have to modify it to your needs yourself:

 

Sub GetIDs

Objects = ActiveDocument.ActiveSheet.GetSheetObjects
For i = lBound(Objects) To uBound(Objects)
    id = Objects(i).GetObjectId
    msgbox("ID = " & id)
next

end sub


talk is cheap, supply exceeds demand

View solution in original post

Not applicable
Author

can i get the list of variables which i have created in variable Overview in macro