Qlik Community

QlikView Documents

Documents for QlikView related information.

Changing tabs color in active sheet with help VB Script

Partner
Partner

Changing tabs color in active sheet with help VB Script

     Changing tabs color in active sheet can do app more user frendly. You can do it without using vb script, but it have some restriction. For example you should to know sheet name always. Using vb script have no that restriction.

I offer you a piece of code:

    sub ChangeColorActive   

     

    'sets the value non active color of all sheets  

     

        for i=0 to ActiveDocument.NoOfSheets-1   

     

            set vSheet = ActiveDocument.GetSheet(i)   

     

            set vSheetProp = vSheet.GetProperties   

     

            vSheetProp.TabAttr.BgColor.PrimaryCol.Col = RGB(241,238,229)   

     

            vSheetProp.TabAttr.FgColor.PrimaryCol.Col = RGB(232,98,32)   

     

            vSheetProp.TabAttr.Mode = 2   

     

            vSheet.SetProperties vSheetProp   

     

        next   

     

    'Determine active sheet and sets the value active color

  

        set vSheet = ActiveDocument.ActiveSheet   

     

        set vSheetProp = vSheet.GetProperties   

     

        vSheetProp.TabAttr.BgColor.PrimaryCol.Col = RGB(67,117,115)   

     

        vSheetProp.TabAttr.FgColor.PrimaryCol.Col = RGB(250,245,120)   

     

        vSheetProp.TabAttr.Mode = 2   

     

        vSheet.SetProperties vSheetProp   

     

    End sub   

That macro you should choose like trigger in every sheets your app in OnActivateSheet side.

Comments
carbal1952
Contributor II

It's a great, great idea; thank you.

CB.

Partner
Partner

Thanks for the comment.

I hope that will help you.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2016-08-16 06:12 AM
Updated by: