Allgemeines Makros and Automatisation Qlik QlikView Workarounds Tips n Tricks

Read and Write QlikView ObjectIDs by Macro

Here is a short script on how to read and write Object Id’s:

SUB ReadObjectsAndSetId(SheetName)

    rem ** minimize all sheet objects on sheet Main **
    rem Author Philipp Frenzel

    set s=ActiveDocument.Sheets(SheetName)
    for i=0 to s.NoOfSheetObjects-1
        'the formula for our rights management
        varVisibility = s.GetProperties.SheetId & s.SheetObjects(i).getObjectId

        Set obj = ActiveDocument.GetSheetObject(s.SheetObjects(i).getObjectId)

        Set objProp = obj.GetProperties        
        Set objExpr = objProp.Layout.Frame.Title

        ' toggle invisible property of chart expression
        ' based on value of DEPT field selection
        objExpr.Expression.v = varVisibility
        obj.SetProperties objProp


SUB LoopSheets

    rem ** loop through all sheets **
    rem Rights by Frenzel GmbH
    rem Author Philipp Frenzel
    for i = 0 to ActiveDocument.NoOfSheets - 1
        set ss= ActiveDocument.GetSheet(i)
        varCompare = ss.GetProperties.Name     
        IF LEFT(varCompare,7) <> "Sandbox" THEN
             ReadObjectsAndSetId varCompare
        END IF


Schreibe einen Kommentar