Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Calling macro Function in BackEnd

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
6 Replies

Re: Calling macro Function in BackEnd

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

Re: Calling macro Function in BackEnd

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

Re: Calling macro Function in BackEnd

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

Re: Calling macro Function in BackEnd

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

Re: Calling macro Function in BackEnd

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
Not applicable

Re: Calling macro Function in BackEnd

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

Community Browser