Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Access Sheet & Object VBS

Hello,

I was looking around how to switch between sheets and how to access individual object.

Hope this might help a bit.

Sub Loop_Sheets_And_Objects

    'loop through all sheets

    for i = 0 to ActiveDocument.NoOfSheets - 1

        'Switching between Sheets

        'ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name).Activate

        'msgbox(ActiveDocument.Sheets(i).GetProperties.Name)

        set s=ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)

        orignumber=s.NoOfSheetObjects

        for j=0 to orignumber-1

             rem ** get unique object ID for given object on sheet **

             set so = s.SheetObjects(j)

             'msgbox(so.GetObjectId)

             id = so.GetObjectId

             'msgbox("ID = " & id)

             'Access on specific Object Id

             IF id="Document\T_DAILY_SUM" THEN

                 msgbox("Access on a table")

             END IF

        next

    next   

End Sub