Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rbalatbat
Contributor II
Contributor II

global macro for listbox properties change

Hi !

Can you help me create a simple VB code that would make all my listbox objects show the lock/unlock icon.

4 Replies
ecolomer
Master II
Master II

Here you have an example for Lock Fields and Unlock them

sub Ventas

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

  ActiveDocument.Fields("Tipo").Select "3"

  ActiveDocument.Fields("Tipo").Lock

end sub

sub Compras

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

  ActiveDocument.Fields("Tipo").Select "13"

  ActiveDocument.Fields("Tipo").Lock

end sub

Sub BorrarSeleciones

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

end sub

sub Evolucion

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

  ActiveDocument.Fields("Year").Select "2014"

end sub

sub H_Ventas

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

  ActiveDocument.ActivateSheet 1

  ActiveDocument.Fields("Tipo").Select "3"

  ActiveDocument.Fields("Tipo").Lock

end sub

sub H_Compras

  ActiveDocument.UnlockAll

  ActiveDocument.ClearAll(true)

  ActiveDocument.ActivateSheet 2

  ActiveDocument.Fields("Tipo").Select "13"

  ActiveDocument.Fields("Tipo").Lock

end sub

rbalatbat
Contributor II
Contributor II
Author

thanks for the quick help but i need a specific macro that would change all listbox properties, that would change the checkbox property at the caption tab then special Icons lock/unlock "listbox property.JPGcheckbox enable"

rbalatbat
Contributor II
Contributor II
Author

thanks for the quick help but i need a specific macro that would change all listbox properties, that would change the checkbox property at the caption tab then special Icons lock/unlock "

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Have you considered using a style rather than a macro for that?

You can create a style that sets the caption bar options for list boxes only, select all the objects on a sheet and apply the style. You will have to do that on each sheet though, but it is easier to apply to multiple models than a macro.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein